[gtk+/gtk-style-context: 169/191] GtkCssProvider: Small optimization.



commit 2de39b880e90000276224e1e4ba31d54672c3879
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 25142a1..438e7d6 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]