[gtk+] builder: Cosmetic changes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] builder: Cosmetic changes
- Date: Tue, 20 Oct 2015 10:15:54 +0000 (UTC)
commit 45fa145034f54ea059dabe462fe592295841d75a
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 19 14:58:35 2015 -0400
builder: Cosmetic changes
Use an iter instead of g_hash_table_forall.
gtk/gtkbuilder.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 5b61334..d6722a0 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]