summaryrefslogtreecommitdiffstats
path: root/src/gui/text
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/gui/text
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/gui/text')
-rw-r--r--src/gui/text/unix/qfontconfigdatabase.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/text/unix/qfontconfigdatabase.cpp b/src/gui/text/unix/qfontconfigdatabase.cpp
index c9f3c3cb81..ee9d323747 100644
--- a/src/gui/text/unix/qfontconfigdatabase.cpp
+++ b/src/gui/text/unix/qfontconfigdatabase.cpp
@@ -810,8 +810,7 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString &family, QFont
FcPatternDestroy(pattern);
if (fontSet) {
- QDuplicateTracker<QString> duplicates;
- duplicates.reserve(fontSet->nfont + 1);
+ QDuplicateTracker<QString> duplicates(fontSet->nfont + 1);
(void)duplicates.hasSeen(family.toCaseFolded());
for (int i = 0; i < fontSet->nfont; i++) {
FcChar8 *value = nullptr;