diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-04-21 15:31:06 (GMT) |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2011-04-29 10:59:51 (GMT) |
commit | 6a53f17c7039f1a5405912a4a645572e215410bb (patch) | |
tree | fc282ebbb67def71e5f39cb055e959bcff380b37 | |
parent | 10fd0d3e5c88c7b0265db3acdd75cb3d6f35ee63 (diff) | |
download | Qt-6a53f17c7039f1a5405912a4a645572e215410bb.zip Qt-6a53f17c7039f1a5405912a4a645572e215410bb.tar.gz Qt-6a53f17c7039f1a5405912a4a645572e215410bb.tar.bz2 |
minor optimization: use QList::reserve()
Reviewed-by: thiago
Reviewed-by: dt
-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 d18571c..868c86d 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) |