mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-12 03:40:10 +00:00
GtkIconTheme: a small optimization
John Lindgren points out in bug 650202 that using judicious use of g_key_file_has_key() can save some cycles in application startup.
This commit is contained in:
parent
0705474be6
commit
5abadc6d95
@ -2570,32 +2570,20 @@ theme_subdir_load (GtkIconTheme *icon_theme,
|
||||
g_free (context_string);
|
||||
}
|
||||
|
||||
max_size = g_key_file_get_integer (theme_file, subdir, "MaxSize", &error);
|
||||
if (error)
|
||||
{
|
||||
max_size = size;
|
||||
if (g_key_file_has_key (theme_file, subdir, "MaxSize", NULL))
|
||||
max_size = g_key_file_get_integer (theme_file, subdir, "MaxSize", NULL);
|
||||
else
|
||||
max_size = size;
|
||||
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
if (g_key_file_has_key (theme_file, subdir, "MinSize", NULL))
|
||||
min_size = g_key_file_get_integer (theme_file, subdir, "MinSize", NULL);
|
||||
else
|
||||
min_size = size;
|
||||
|
||||
min_size = g_key_file_get_integer (theme_file, subdir, "MinSize", &error);
|
||||
if (error)
|
||||
{
|
||||
min_size = size;
|
||||
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
|
||||
threshold = g_key_file_get_integer (theme_file, subdir, "Threshold", &error);
|
||||
if (error)
|
||||
{
|
||||
threshold = 2;
|
||||
|
||||
g_error_free (error);
|
||||
error = NULL;
|
||||
}
|
||||
if (g_key_file_has_key (theme_file, subdir, "Threshold", NULL))
|
||||
threshold = g_key_file_get_integer (theme_file, subdir, "Threshold", NULL);
|
||||
else
|
||||
threshold = 2;
|
||||
|
||||
for (d = icon_theme->priv->dir_mtimes; d; d = d->next)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user