[gtk+/gtk-2-16] Microoptimization in interactive search handling



commit 91a29ddbc86202856aa1a2e6666113fb9e988304
Author: Paolo Borelli <porelli gnome org>
Date:   Sat Jul 18 12:28:05 2009 +0200

    Microoptimization in interactive search handling

 gtk/gtktreeview.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index ce9b1b2..955d4ec 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -14668,7 +14668,6 @@ gtk_tree_view_search_init (GtkWidget   *entry,
 			   GtkTreeView *tree_view)
 {
   gint ret;
-  gint len;
   gint count = 0;
   const gchar *text;
   GtkTreeIter iter;
@@ -14679,7 +14678,7 @@ gtk_tree_view_search_init (GtkWidget   *entry,
   g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
 
   text = gtk_entry_get_text (GTK_ENTRY (entry));
-  len = strlen (text);
+
   model = gtk_tree_view_get_model (tree_view);
   selection = gtk_tree_view_get_selection (tree_view);
 
@@ -14695,7 +14694,7 @@ gtk_tree_view_search_init (GtkWidget   *entry,
 		       tree_view);
     }
 
-  if (len < 1)
+  if (*text == '\0')
     return;
 
   if (!gtk_tree_model_get_iter_first (model, &iter))



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