minor optimization: use QList::reserve()
Reviewed-by: thiago Reviewed-by: dt (cherry picked from commit 6a53f17c7039f1a5405912a4a645572e215410bb)
This commit is contained in:
parent
9590b7b662
commit
e608887ee4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user