From 9ebbc7b5c5eea7499cb60e89502f02b7cfb0b2ad Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 4 Aug 2010 11:36:21 +0200 Subject: [PATCH] GtkCssProvider: Small optimization. --- gtk/gtkcssprovider.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 67dc3f68ce..8deae7e75c 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;