[gtk+] Microoptimization in interactive search handling



commit c564b3ef2b45b995bce9ff14e5b43d1bb0b6b1a5
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 7b8f8d4..b0b9df3 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -14678,7 +14678,6 @@ gtk_tree_view_search_init (GtkWidget   *entry,
 			   GtkTreeView *tree_view)
 {
   gint ret;
-  gint len;
   gint count = 0;
   const gchar *text;
   GtkTreeIter iter;
@@ -14689,7 +14688,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);
 
@@ -14705,7 +14704,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]