From f62c4d0445542287bb620a7708c9652161c5c9db Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 2 May 2012 20:34:15 +0100 Subject: [PATCH 8/9] tp_connection_dispose: use the fast version of int-set iteration There's no good reason why we want to iterate in order. --- telepathy-glib/connection.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/telepathy-glib/connection.c b/telepathy-glib/connection.c index 345ea93..3ec9e4f 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); -- 1.7.10