inspector: Avoid a gratitious use of g_strv_length

No need to count the strings first before iterating over them.
This commit is contained in:
Matthias Clasen 2015-07-16 23:42:55 -04:00
parent 1fb075dbca
commit 02577ddb06

View File

@ -64,7 +64,7 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
GObject *object)
{
GtkTreeIter iter, parent;
gint i, words_len;
gint i;
GtkWidget *widget;
gchar *path, **words;
const gchar *title;
@ -85,8 +85,7 @@ gtk_inspector_selector_set_object (GtkInspectorSelector *oh,
path = gtk_widget_path_to_string (gtk_widget_get_path (widget));
words = g_strsplit (path, " ", 0);
words_len = g_strv_length (words);
for (i = 0; i < words_len; i++)
for (i = 0; words[i]; i++)
{
gtk_tree_store_append (oh->priv->model, &iter, i ? &parent : NULL);
gtk_tree_store_set (oh->priv->model, &iter,