From 70a5fc15fdff380eab3f136eba9992f1d2263957 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Mon, 3 Dec 2018 14:55:40 +0100 Subject: Use a QMultiMap for the fontengine cache Cosmetic, so we can avoid using QMap::insertMulti(). Change-Id: If7c971e127af0537dd28bd25f7803804e7e01170 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont.cpp | 4 ++-- src/gui/text/qfont_p.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 3654c28fc5..38462c6e24 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -2950,9 +2950,9 @@ void QFontCache::insertEngine(const Key &key, QFontEngine *engine, bool insertMu data.timestamp = ++current_timestamp; if (insertMulti) - engineCache.insertMulti(key, data); - else engineCache.insert(key, data); + else + engineCache.replace(key, data); // only increase the cost if this is the first time we insert the engine if (++engineCacheCount[engine] == 1) increaseCost(engine->cache_cost); diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index 09c18de5a6..14c01766ba 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -274,7 +274,7 @@ public: uint hits; }; - typedef QMap EngineCache; + typedef QMultiMap EngineCache; EngineCache engineCache; QHash engineCacheCount; -- cgit v1.2.3