[gtk+/wip/cssnode3: 71/101] cssstyle: Add optimization



commit cb78ee6acefd1c396f4391dc3210a20f67c30969
Author: Benjamin Otte <otte redhat com>
Date:   Sun Feb 22 18:04:43 2015 +0100

    cssstyle: Add optimization
    
    There is no difference between a style and itself.

 gtk/gtkcssstyle.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 040998b..0849191 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -82,6 +82,9 @@ gtk_css_style_get_difference (GtkCssStyle *style,
   GtkBitmask *result;
   guint i, len;
 
+  if (style == other)
+    return _gtk_bitmask_new ();
+
   result = _gtk_bitmask_new ();
   len = _gtk_css_style_property_get_n_properties ();
   for (i = 0; i < len; i++)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]