summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qresource.cpp
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2015-06-08 22:56:55 +0100
committerSérgio Martins <sergio.martins@kdab.com>2015-06-11 13:36:15 +0000
commit552fba23862d2f2c88bd09202b8c1b5904830128 (patch)
tree111d169f156598868bb562d903b1aa5a2928174d /src/corelib/io/qresource.cpp
parent6b5029199d8eab325992e07fa7c98718c9533ca0 (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/qresource.cpp')
-rw-r--r--src/corelib/io/qresource.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index fbda081114..345f0bd65d 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -790,6 +790,7 @@ QStringList QResourceRoot::children(int node) const
offset += 4;
const int child_off = (tree[offset+0] << 24) + (tree[offset+1] << 16) +
(tree[offset+2] << 8) + (tree[offset+3] << 0);
+ ret.reserve(child_count);
for(int i = child_off; i < child_off+child_count; ++i)
ret << name(i);
}