summaryrefslogtreecommitdiff
path: root/libsoup/soup-form.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-06-03 09:36:14 -0400
committerDan Winship <danw@gnome.org>2012-07-13 14:18:35 -0400
commitf4650169ef770f96e42fb85c13737969adf5e7bb (patch)
tree60734e1f2dc2d2b13ff84f1c945c653e79fa7f59 /libsoup/soup-form.c
parent04ee1a5d069fd3d212f510f6ce42afb66202c3ab (diff)
downloadlibsoup-f4650169ef770f96e42fb85c13737969adf5e7bb.tar.gz
Replace g_hash_table_foreach() with GHashTableIter
or g_hash_table_new_full() when the foreach was only being used for cleanup.
Diffstat (limited to 'libsoup/soup-form.c')
-rw-r--r--libsoup/soup-form.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libsoup/soup-form.c b/libsoup/soup-form.c
index a781d3ce..3fe6578c 100644
--- a/libsoup/soup-form.c
+++ b/libsoup/soup-form.c
@@ -239,12 +239,6 @@ encode_pair (GString *str, const char *name, const char *value)
append_form_encoded (str, value);
}
-static void
-hash_encode_foreach (gpointer name, gpointer value, gpointer str)
-{
- encode_pair (str, name, value);
-}
-
/**
* soup_form_encode:
* @first_field: name of the first form field
@@ -295,8 +289,12 @@ char *
soup_form_encode_hash (GHashTable *form_data_set)
{
GString *str = g_string_new (NULL);
+ GHashTableIter iter;
+ gpointer name, value;
- g_hash_table_foreach (form_data_set, hash_encode_foreach, str);
+ g_hash_table_iter_init (&iter, form_data_set);
+ while (g_hash_table_iter_next (&iter, &name, &value))
+ encode_pair (str, name, value);
return g_string_free (str, FALSE);
}