summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2014-03-28 08:41:10 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-31 22:54:14 +0200
commita6f8aa0ae1d5a1d1099df1891ea60b14b6eb6065 (patch)
treee1a6cf49d60b02498fbc6373c477c5604083b9a7 /src/corelib
parent08b8f9d0872cc68e90599c6896f3bef113f7b764 (diff)
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>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qstringlist.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp
index 30be41a4bd..a9d704ca4c 100644
--- a/src/corelib/tools/qstringlist.cpp
+++ b/src/corelib/tools/qstringlist.cpp
@@ -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)