summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-04-21 17:31:06 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-10 12:54:52 +0200
commite608887ee4fbfda84ab26d22d8cb9283291bb238 (patch)
tree79e7e73af34014ef3ae345e3f2f32e25f9177e57 /src/corelib
parent9590b7b66223a9d42778957c4b86939b68abb1b5 (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.cpp2
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)