QUrlQuery: fix a very expensive always-true check
In a non-const function, if (d), d being a QSharedDataPointer, will resolve to if(d.data()), which detaches and returns a pointer to an unshared copy of the data. Thus, the test if (d) is always true. Fix by explicit use of constData(), as in other QUrlQuery functions. Change-Id: Ib926abdcdb069d69e34c3202c4cf451b7fc6a329 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
5c81863019
commit
96dc9a19ae
|
|
@ -733,7 +733,7 @@ QStringList QUrlQuery::allQueryItemValues(const QString &key, QUrl::ComponentFor
|
|||
*/
|
||||
void QUrlQuery::removeQueryItem(const QString &key)
|
||||
{
|
||||
if (d) {
|
||||
if (d.constData()) {
|
||||
Map::iterator it = d->findKey(key);
|
||||
if (it != d->itemList.end())
|
||||
d->itemList.erase(it);
|
||||
|
|
|
|||
Loading…
Reference in New Issue