diff options
author | Matthias Clasen <mclasen@redhat.com> | 2015-10-19 14:58:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-10-20 06:14:57 -0400 |
commit | 45fa145034f54ea059dabe462fe592295841d75a (patch) | |
tree | b246faa25b75e352742e8f710d4e933473fdc513 /gtk/gtkbuilder.c | |
parent | eec75ee9d6fef38667a325e40d50b735bb0593ae (diff) | |
download | gtk+-45fa145034f54ea059dabe462fe592295841d75a.tar.gz |
builder: Cosmetic changes
Use an iter instead of g_hash_table_forall.
Diffstat (limited to 'gtk/gtkbuilder.c')
-rw-r--r-- | gtk/gtkbuilder.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 5b61334009..d6722a0cfb 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -1445,14 +1445,6 @@ gtk_builder_get_object (GtkBuilder *builder, return g_hash_table_lookup (builder->priv->objects, name); } -static void -object_add_to_list (gchar *object_id, - GObject *object, - GSList **list) -{ - *list = g_slist_prepend (*list, object); -} - /** * gtk_builder_get_objects: * @builder: a #GtkBuilder @@ -1471,10 +1463,14 @@ GSList * gtk_builder_get_objects (GtkBuilder *builder) { GSList *objects = NULL; + GObject *object; + GHashTableIter iter; g_return_val_if_fail (GTK_IS_BUILDER (builder), NULL); - g_hash_table_foreach (builder->priv->objects, (GHFunc)object_add_to_list, &objects); + g_hash_table_iter_init (&iter, builder->priv->objects); + while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&object)) + objects = g_slist_prepend (objects, object); return g_slist_reverse (objects); } |