summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-01-28 20:05:21 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2010-02-16 18:10:38 (GMT)
commit5723f1bcb538a5624cbed871c34507ff26285878 (patch)
tree650fcef0b486e090732d5cf314296c0b262177f4 /src
parent7134f8b25a7a69960767280f9c23981b08d8e68b (diff)
downloadQt-5723f1bcb538a5624cbed871c34507ff26285878.zip
Qt-5723f1bcb538a5624cbed871c34507ff26285878.tar.gz
Qt-5723f1bcb538a5624cbed871c34507ff26285878.tar.bz2
optimization: use QList::reserve() in QSet::toList()
Reviewed-by: Denis Reviewed-by: Joao
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qset.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h
index 6525880..9acbed4 100644
--- a/src/corelib/tools/qset.h
+++ b/src/corelib/tools/qset.h
@@ -292,6 +292,7 @@ template <typename T>
Q_OUTOFLINE_TEMPLATE QList<T> QSet<T>::toList() const
{
QList<T> result;
+ result.reserve(size());
typename QSet<T>::const_iterator i = constBegin();
while (i != constEnd()) {
result.append(*i);