From 40815d4d5540156c46ec33756513aa891223e60a Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Tue, 16 Mar 2021 19:55:53 +0400 Subject: [PATCH] Replace QMap with base::flat_map for pointer keys --- ui/style/style_core_icon.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/style/style_core_icon.cpp b/ui/style/style_core_icon.cpp index 8b2b071..c250beb 100644 --- a/ui/style/style_core_icon.cpp +++ b/ui/style/style_core_icon.cpp @@ -19,7 +19,7 @@ uint32 colorKey(QColor c) { return (((((uint32(c.red()) << 8) | uint32(c.green())) << 8) | uint32(c.blue())) << 8) | uint32(c.alpha()); } -QMap iconMasks; +base::flat_map iconMasks; QMap, QPixmap> iconPixmaps; OrderedSet iconData; @@ -251,11 +251,11 @@ void MonoIcon::ensureLoaded() const { _size = readGeneratedSize(_mask, Scale()); if (_size.isEmpty()) { - auto i = iconMasks.constFind(_mask); + auto i = iconMasks.find(_mask); if (i == iconMasks.cend()) { - i = iconMasks.insert(_mask, createIconMask(_mask, Scale())); + i = iconMasks.emplace(_mask, createIconMask(_mask, Scale())).first; } - _maskImage = i.value(); + _maskImage = i->second; createCachedPixmap(); }