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:
Marc Mutz 2014-03-28 08:41:10 +01:00 committed by The Qt Project
parent 08b8f9d087
commit a6f8aa0ae1

View File

@ -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)