Exit early in gtk_style_context_update_cache codepaths

If lookup->missing is empty we don't need to continue looking.
We short circuit in several places as this can happen
after iteratively makeign lookup->missing smaller.
This commit is contained in:
Alexander Larsson 2012-11-09 10:15:23 +01:00
parent 77912a65e2
commit 55d65571f3
2 changed files with 8 additions and 1 deletions

View File

@ -1603,6 +1603,9 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
ruleset->styles[j].section,
ruleset->styles[j].value);
}
if (_gtk_bitmask_is_empty (_gtk_css_lookup_get_missing (lookup)))
break;
}
}

View File

@ -2943,6 +2943,9 @@ gtk_style_context_update_cache (GtkStyleContext *context,
GHashTableIter iter;
gpointer key, value;
if (_gtk_bitmask_is_empty (parent_changes))
return;
priv = context->priv;
g_hash_table_iter_init (&iter, priv->style_data);
@ -2959,7 +2962,8 @@ gtk_style_context_update_cache (GtkStyleContext *context,
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
changes = _gtk_bitmask_union (changes, data->store->depends_on_font_size);
build_properties (context, data->store, info, changes);
if (!_gtk_bitmask_is_empty (changes))
build_properties (context, data->store, info, changes);
_gtk_bitmask_free (changes);
}