summaryrefslogtreecommitdiff
path: root/json-glib/json-object.c
diff options
context:
space:
mode:
Diffstat (limited to 'json-glib/json-object.c')
-rw-r--r--json-glib/json-object.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/json-glib/json-object.c b/json-glib/json-object.c
index 1a655de..438366b 100644
--- a/json-glib/json-object.c
+++ b/json-glib/json-object.c
@@ -141,16 +141,9 @@ object_set_member_internal (JsonObject *object,
* pointer to its name, to avoid keeping invalid pointers
* once we replace the key in the hash table
*/
- for (l = object->members_ordered; l != NULL; l = l->next)
- {
- gchar *tmp = l->data;
-
- if (strcmp (tmp, name) == 0)
- {
- l->data = name;
- break;
- }
- }
+ l = g_list_find_custom (object->members_ordered, name, (GCompareFunc) strcmp);
+ if (l != NULL)
+ l->data = name;
}
g_hash_table_replace (object->members, name, node);