QStringList: use QList:.swap(int,int) in removeDuplicates instead of assignment
This is faster because it just swaps the pointers stored instead of touching the refcounts. It's the same as qMove()ing the right-hand-side, but benefits C++98, too. Change-Id: I6b7e3d0e5c7eb81f88fe9069d6662335d24aa86c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
08b8f9d087
commit
a6f8aa0ae1
@ -726,7 +726,7 @@ int QtPrivate::QStringList_removeDuplicates(QStringList *that)
|
||||
continue;
|
||||
seen.insert(s);
|
||||
if (j != i)
|
||||
(*that)[j] = s;
|
||||
that->swap(i, j);
|
||||
++j;
|
||||
}
|
||||
if (n != j)
|
||||
|
Loading…
Reference in New Issue
Block a user