Microoptimization in interactive search handling

This commit is contained in:
Paolo Borelli 2009-07-18 12:28:05 +02:00
parent 48f1b45b62
commit c564b3ef2b

View File

@ -14678,7 +14678,6 @@ gtk_tree_view_search_init (GtkWidget *entry,
GtkTreeView *tree_view) GtkTreeView *tree_view)
{ {
gint ret; gint ret;
gint len;
gint count = 0; gint count = 0;
const gchar *text; const gchar *text;
GtkTreeIter iter; GtkTreeIter iter;
@ -14689,7 +14688,7 @@ gtk_tree_view_search_init (GtkWidget *entry,
g_return_if_fail (GTK_IS_TREE_VIEW (tree_view)); g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
text = gtk_entry_get_text (GTK_ENTRY (entry)); text = gtk_entry_get_text (GTK_ENTRY (entry));
len = strlen (text);
model = gtk_tree_view_get_model (tree_view); model = gtk_tree_view_get_model (tree_view);
selection = gtk_tree_view_get_selection (tree_view); selection = gtk_tree_view_get_selection (tree_view);
@ -14705,7 +14704,7 @@ gtk_tree_view_search_init (GtkWidget *entry,
tree_view); tree_view);
} }
if (len < 1) if (*text == '\0')
return; return;
if (!gtk_tree_model_get_iter_first (model, &iter)) if (!gtk_tree_model_get_iter_first (model, &iter))