[gtk/wip/baedert/icontheme: 807/821] gtkicontheme: Avoid a get_icon_flags call
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/icontheme: 807/821] gtkicontheme: Avoid a get_icon_flags call
- Date: Sun, 21 Jul 2019 08:39:50 +0000 (UTC)
commit f9950ae50e7c1f233e46163ac607efa0821582b6
Author: Timm Bäder <mail baedert org>
Date: Tue May 21 11:07:23 2019 +0200
gtkicontheme: Avoid a get_icon_flags call
We're only using the value of the first call at all if
symbolic_suffix & ICON_SUFFIX_PNG is FALSE.
gtk/gtkicontheme.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index a1fde091c7..5e4ebdc627 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2814,10 +2814,6 @@ theme_dir_get_icon_suffix (IconThemeDir *dir,
if (dir->cache)
{
- suffix = (IconSuffix)gtk_icon_cache_get_icon_flags (dir->cache,
- icon_name,
- dir->subdir_index);
-
if (icon_name_is_symbolic (icon_name))
{
/* Look for foo-symbolic.symbolic.png, as the cache only stores the ".png" suffix */
@@ -2829,7 +2825,15 @@ theme_dir_get_icon_suffix (IconThemeDir *dir,
if (symbolic_suffix & ICON_SUFFIX_PNG)
suffix = ICON_SUFFIX_SYMBOLIC_PNG;
+ else
+ suffix = (IconSuffix)gtk_icon_cache_get_icon_flags (dir->cache,
+ icon_name,
+ dir->subdir_index);
}
+ else
+ suffix = (IconSuffix)gtk_icon_cache_get_icon_flags (dir->cache,
+ icon_name,
+ dir->subdir_index);
if (has_icon_file)
*has_icon_file = suffix & HAS_ICON_FILE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]