diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2015-06-08 22:56:55 +0100 |
---|---|---|
committer | Sérgio Martins <sergio.martins@kdab.com> | 2015-06-11 13:36:15 +0000 |
commit | 552fba23862d2f2c88bd09202b8c1b5904830128 (patch) | |
tree | 111d169f156598868bb562d903b1aa5a2928174d /src/corelib/io/qurlquery.cpp | |
parent | 6b5029199d8eab325992e07fa7c98718c9533ca0 (diff) |
core: Add several QList::reserve() calls.
Reduces reallocations.
Change-Id: Ib63539fb690a80245d8fe81ff8468e79ffa8e57c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/io/qurlquery.cpp')
-rw-r--r-- | src/corelib/io/qurlquery.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp index 91e6e21e20..2b695a4f7b 100644 --- a/src/corelib/io/qurlquery.cpp +++ b/src/corelib/io/qurlquery.cpp @@ -642,6 +642,7 @@ QList<QPair<QString, QString> > QUrlQuery::queryItems(QUrl::ComponentFormattingO QList<QPair<QString, QString> > result; Map::const_iterator it = d->itemList.constBegin(); Map::const_iterator end = d->itemList.constEnd(); + result.reserve(d->itemList.count()); for ( ; it != end; ++it) result << qMakePair(d->recodeToUser(it->first, encoding), d->recodeToUser(it->second, encoding)); |