summaryrefslogtreecommitdiff
path: root/gtk/gtkstylecontext.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-11-09 10:15:23 +0100
committerAlexander Larsson <alexl@redhat.com>2012-11-09 10:15:23 +0100
commit55d65571f37d3f6428e418c4e8bc4171c24a9741 (patch)
treedd9ddb39831c81a7085ad3c1bb191a5e155fef9f /gtk/gtkstylecontext.c
parent77912a65e2aa6eb9cfee994fa93bbfbc6b9f8538 (diff)
downloadgtk+-55d65571f37d3f6428e418c4e8bc4171c24a9741.tar.gz
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.
Diffstat (limited to 'gtk/gtkstylecontext.c')
-rw-r--r--gtk/gtkstylecontext.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 33776d285c..c0253a4993 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -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);
}