From 6da4ff824e5ea8581370e774edcad265d83e3562 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 2 May 2020 23:03:39 +0200 Subject: Port two more local QSets to QDuplicateTrackers Apart from a more fitting, minimal, API, QDuplicateTracker also transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or at least reduce, memory allocations. Change-Id: Ia9e837ebba88aeb1916da041fc8460a0692a03e4 Reviewed-by: Lars Knoll --- src/gui/text/qfontengine_qpf2.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/gui/text/qfontengine_qpf2.cpp') diff --git a/src/gui/text/qfontengine_qpf2.cpp b/src/gui/text/qfontengine_qpf2.cpp index d636bca510..7178ef2928 100644 --- a/src/gui/text/qfontengine_qpf2.cpp +++ b/src/gui/text/qfontengine_qpf2.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -346,7 +347,7 @@ bool QFontEngineQPF2::stringToCMap(const QChar *str, int len, QGlyphLayout *glyp } #if defined(DEBUG_FONTENGINE) - QSet seenGlyphs; + QDuplicateTracker seenGlyphs; #endif int glyph_pos = 0; @@ -366,10 +367,8 @@ bool QFontEngineQPF2::stringToCMap(const QChar *str, int len, QGlyphLayout *glyp glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); #if 0 && defined(DEBUG_FONTENGINE) QChar c(uc); - if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c)) + if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.hasSeen(c)) qDebug() << "glyph for character" << c << '/' << Qt::hex << uc << "is" << Qt::dec << glyphs[glyph_pos].glyph; - - seenGlyphs.insert(c); #endif ++glyph_pos; } -- cgit v1.2.3