summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstylechange.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2016-01-16 23:15:11 +0100
committerBenjamin Otte <otte@redhat.com>2016-01-16 23:58:37 +0100
commit6e6cbd7316032a7fe23f8f1c4edf4ca0a5d9280b (patch)
tree25ee2802d4a4669586bad69af7d048dd2302e17f /gtk/gtkcssstylechange.c
parentc904efef5381a7b058ed17c077059707909e86d1 (diff)
downloadgtk+-6e6cbd7316032a7fe23f8f1c4edf4ca0a5d9280b.tar.gz
stylechange: Do the right thing when old and new style are equal
We don't need to compare all their CSS values to figure out that nothing changed. We know that.
Diffstat (limited to 'gtk/gtkcssstylechange.c')
-rw-r--r--gtk/gtkcssstylechange.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkcssstylechange.c b/gtk/gtkcssstylechange.c
index 50eac153e1..0ce6120f30 100644
--- a/gtk/gtkcssstylechange.c
+++ b/gtk/gtkcssstylechange.c
@@ -33,6 +33,10 @@ gtk_css_style_change_init (GtkCssStyleChange *change,
change->affects = 0;
change->changes = _gtk_bitmask_new ();
+
+ /* Make sure we don't do extra work if old and new are equal. */
+ if (old_style == new_style)
+ change->n_compared = GTK_CSS_PROPERTY_N_PROPERTIES;
}
void