diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-02 20:34:15 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-05-02 20:34:15 +0100 |
commit | f62c4d0445542287bb620a7708c9652161c5c9db (patch) | |
tree | 933b201d660869e1be936e01d93832f4db3e40e2 /telepathy-glib/connection.c | |
parent | 55c45e9b080a3d1ce08f3b9bb68629334b570601 (diff) | |
download | telepathy-glib-f62c4d0445542287bb620a7708c9652161c5c9db.tar.gz |
tp_connection_dispose: use the fast version of int-set iteration
There's no good reason why we want to iterate in order.
Diffstat (limited to 'telepathy-glib/connection.c')
-rw-r--r-- | telepathy-glib/connection.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 345ea93c0..3ec9e4f48 100644 --- a/telepathy-glib/connection.c +++ b/telepathy-glib/connection.c @@ -1571,9 +1571,7 @@ tp_connection_dispose (GObject *object) if (self->priv->interests != NULL) { - TpIntsetIter iter = TP_INTSET_ITER_INIT (self->priv->interests); guint size = tp_intset_size (self->priv->interests); - GPtrArray *strings; /* Before freeing the set of tokens in which we declared an * interest, cancel those interests. We'll still get the signals @@ -1581,11 +1579,17 @@ tp_connection_dispose (GObject *object) * because the CM uses distributed refcounting. */ if (size > 0) { + TpIntsetFastIter iter; + GPtrArray *strings; + guint element; + strings = g_ptr_array_sized_new (size + 1); - while (tp_intset_iter_next (&iter)) + tp_intset_fast_iter_init (&iter, self->priv->interests); + + while (tp_intset_fast_iter_next (&iter, &element)) g_ptr_array_add (strings, - (gchar *) g_quark_to_string (iter.element)); + (gchar *) g_quark_to_string (element)); g_ptr_array_add (strings, NULL); |