[gtk+/gtk-style-context: 165/276] GtkCssProvider: Small optimization.



commit 29025401df8a336f0230413bc2b609e677be2901
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Aug 4 11:36:21 2010 +0200

    GtkCssProvider: Small optimization.

 gtk/gtkcssprovider.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 67dc3f6..8deae7e 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -429,10 +429,12 @@ compare_selector (GtkWidgetPath *path,
   GSList *elements = selector->elements;
   gboolean match = TRUE;
   guint64 score = 0;
+  guint len;
   guint i = 0;
 
-  while (elements && match &&
-         i < gtk_widget_path_length (path))
+  len = gtk_widget_path_length (path);
+
+  while (elements && match && i < len)
     {
       SelectorElement *elem;
       guint8 elem_score;



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