From 467b15a20c3d6eb611ea5f6ccffd5fc0df81b0c4 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 10 Nov 2016 12:45:49 +0100 Subject: Improve use of QHash to minimize double hashing Avoid looking up by key twice in a row in various locations, but instead using iterators and index lookup. Change-Id: I61a079115199ab9c041ad3a26d36b45ee3f775e0 Reviewed-by: Thiago Macieira --- src/gui/image/qiconloader.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/gui/image/qiconloader.cpp') diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index eda9d6f24e..17d77a07b5 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -383,13 +383,11 @@ QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName, // Used to protect against potential recursions visited << themeName; - QIconTheme theme = themeList.value(themeName); + QIconTheme &theme = themeList[themeName]; if (!theme.isValid()) { theme = QIconTheme(themeName); if (!theme.isValid()) theme = QIconTheme(fallbackTheme()); - - themeList.insert(themeName, theme); } const QStringList contentDirs = theme.contentDirs(); -- cgit v1.2.3