From a7564e2657dcbd2f69c357d7c49c9326a23ee021 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 12 Jul 2021 11:15:44 +0200 Subject: QDuplicateTracker: accept the number of elements to reserve as a ctor argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- src/gui/text/unix/qfontconfigdatabase.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/gui/text') 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 duplicates; - duplicates.reserve(fontSet->nfont + 1); + QDuplicateTracker duplicates(fontSet->nfont + 1); (void)duplicates.hasSeen(family.toCaseFolded()); for (int i = 0; i < fontSet->nfont; i++) { FcChar8 *value = nullptr; -- cgit v1.2.3