stylecontext: Only look up stuff in the cache that can be in the cache

Only saved styles are stored in the cache so we should look only those
up there.
This commit is contained in:
Benjamin Otte 2014-12-13 02:07:34 +01:00
parent 77b876fad3
commit 85dd685b3f

View File

@ -729,6 +729,8 @@ style_values_lookup (GtkStyleContext *context)
g_assert (priv->widget != NULL || priv->widget_path != NULL); g_assert (priv->widget != NULL || priv->widget_path != NULL);
if (gtk_style_context_is_saved (context))
{
values = g_hash_table_lookup (priv->style_values, info->decl); values = g_hash_table_lookup (priv->style_values, info->decl);
if (values) if (values)
{ {
@ -736,9 +738,6 @@ style_values_lookup (GtkStyleContext *context)
return values; return values;
} }
if (gtk_style_context_is_saved (context))
{
values = gtk_css_static_style_new (); values = gtk_css_static_style_new ();
g_hash_table_insert (priv->style_values, g_hash_table_insert (priv->style_values,
gtk_css_node_declaration_ref (info->decl), gtk_css_node_declaration_ref (info->decl),