summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2021-07-12 11:15:44 +0200
committerMarc Mutz <marc.mutz@kdab.com>2021-07-14 08:57:39 +0200
commita7564e2657dcbd2f69c357d7c49c9326a23ee021 (patch)
tree1be6fa8b0a06bf1936059b7e22eed42059d41eb0 /src/tools
parentfcfc854def12500658d5d863797169279b698498 (diff)
QDuplicateTracker: accept the number of elements to reserve as a ctor argument
This prevents us from first reserve()ing Prealloc elements, and then possibly reserve()ing a larger number, which leaves the first bucket list's memory unused. Consequently, deprecate reserve(). Change-Id: Ifc0a5a021097f4589557e7b5e45d9d0892797ade Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/moc/moc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index bce75644f5..d57e43b59d 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -1833,7 +1833,7 @@ void Moc::checkProperties(ClassDef *cdef)
// specify get function, for compatibiliy we accept functions
// returning pointers, or const char * for QByteArray.
//
- QDuplicateTracker<QByteArray> definedProperties;
+ QDuplicateTracker<QByteArray> definedProperties(cdef->propertyList.count());
for (int i = 0; i < cdef->propertyList.count(); ++i) {
PropertyDef &p = cdef->propertyList[i];
if (definedProperties.hasSeen(p.name)) {