[Telepathy-commits] [telepathy-mission-control/master] _mcd_deepcopy_asv: use tp_g_hash_table_update
Will Thompson
will.thompson at collabora.co.uk
Wed Dec 17 04:17:27 PST 2008
---
src/mcd-misc.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/mcd-misc.c b/src/mcd-misc.c
index 77959ba..68335a7 100644
--- a/src/mcd-misc.c
+++ b/src/mcd-misc.c
@@ -94,21 +94,12 @@ GHashTable *
_mcd_deepcopy_asv (GHashTable *asv)
{
GHashTable *copy;
- GHashTableIter iter;
- gpointer ht_key, ht_value;
copy = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
(GDestroyNotify)tp_g_value_slice_free);
- g_hash_table_iter_init (&iter, asv);
- while (g_hash_table_iter_next (&iter, &ht_key, &ht_value))
- {
- GValue *value = g_slice_new0 (GValue);
- g_value_init (value, G_VALUE_TYPE (ht_value));
- g_value_copy (ht_value, value);
-
- g_hash_table_insert (copy, g_strdup (ht_key), value);
- }
+ tp_g_hash_table_update (copy, asv, (GBoxedCopyFunc) g_strdup,
+ (GBoxedCopyFunc) tp_g_value_slice_dup);
return copy;
}
--
1.5.6.5
More information about the Telepathy-commits
mailing list