diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-04-21 17:31:06 +0200 |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-05-10 12:54:52 +0200 |
commit | e608887ee4fbfda84ab26d22d8cb9283291bb238 (patch) | |
tree | 79e7e73af34014ef3ae345e3f2f32e25f9177e57 /src/corelib | |
parent | 9590b7b66223a9d42778957c4b86939b68abb1b5 (diff) |
minor optimization: use QList::reserve()
Reviewed-by: thiago
Reviewed-by: dt
(cherry picked from commit 6a53f17c7039f1a5405912a4a645572e215410bb)
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/io/qprocess.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index d18571ca6c..868c86d774 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -190,6 +190,7 @@ template<> void QSharedDataPointer<QProcessEnvironmentPrivate>::detach() QStringList QProcessEnvironmentPrivate::toList() const { QStringList result; + result.reserve(hash.size()); Hash::ConstIterator it = hash.constBegin(), end = hash.constEnd(); for ( ; it != end; ++it) { @@ -224,6 +225,7 @@ QProcessEnvironment QProcessEnvironmentPrivate::fromList(const QStringList &list QStringList QProcessEnvironmentPrivate::keys() const { QStringList result; + result.reserve(hash.size()); Hash::ConstIterator it = hash.constBegin(), end = hash.constEnd(); for ( ; it != end; ++it) |