[gtk/wip/otte/css: 1/5] css: Don't do the "all set" test



commit 65050a1c8112997d38283ca8f09e89801dacb498
Author: Benjamin Otte <otte redhat com>
Date:   Tue Jan 28 17:49:37 2020 +0100

    css: Don't do the "all set" test
    
    We have so many properties that it is basically impossible that all of
    them are set and the time spent checking is higher than the time saved
    if it does indeed happen.

 gtk/gtkcsslookup.c        | 7 -------
 gtk/gtkcsslookupprivate.h | 2 --
 gtk/gtkcssprovider.c      | 3 ---
 3 files changed, 12 deletions(-)
---
diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c
index cfe5bfc5c5..8b0c33b0df 100644
--- a/gtk/gtkcsslookup.c
+++ b/gtk/gtkcsslookup.c
@@ -44,12 +44,6 @@ _gtk_css_lookup_is_missing (const GtkCssLookup *lookup,
   return lookup->values[id].value == NULL;
 }
 
-gboolean
-_gtk_css_lookup_all_set (const GtkCssLookup *lookup)
-{
-  return lookup->n_set_values == GTK_CSS_PROPERTY_N_PROPERTIES;
-}
-
 /**
  * _gtk_css_lookup_set:
  * @lookup: the lookup
@@ -75,7 +69,6 @@ _gtk_css_lookup_set (GtkCssLookup  *lookup,
 
   lookup->values[id].value = value;
   lookup->values[id].section = section;
-  lookup->n_set_values ++;
 }
 
 /**
diff --git a/gtk/gtkcsslookupprivate.h b/gtk/gtkcsslookupprivate.h
index 34acd504c3..ef29c4e9b3 100644
--- a/gtk/gtkcsslookupprivate.h
+++ b/gtk/gtkcsslookupprivate.h
@@ -36,7 +36,6 @@ typedef struct {
 } GtkCssLookupValue;
 
 struct _GtkCssLookup {
-  guint              n_set_values;
   GtkCssLookupValue  values[GTK_CSS_PROPERTY_N_PROPERTIES];
 };
 
@@ -44,7 +43,6 @@ void                    _gtk_css_lookup_init                    (GtkCssLookup
 void                    _gtk_css_lookup_destroy                 (GtkCssLookup               *lookup);
 gboolean                _gtk_css_lookup_is_missing              (const GtkCssLookup         *lookup,
                                                                  guint                       id);
-gboolean                _gtk_css_lookup_all_set                 (const GtkCssLookup         *lookup);
 void                    _gtk_css_lookup_set                     (GtkCssLookup               *lookup,
                                                                  guint                       id,
                                                                  GtkCssSection              *section,
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 6db8d88ba6..e2388de1e1 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -489,9 +489,6 @@ gtk_css_style_provider_lookup (GtkStyleProvider             *provider,
                                    ruleset->styles[j].section,
                                    ruleset->styles[j].value);
             }
-
-          if (_gtk_css_lookup_all_set (lookup))
-            break;
         }
 
       g_ptr_array_free (tree_rules, TRUE);


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