telepathy-glib: tp_connection_dispose: use the fast version of int-set iteration

Simon McVittie smcv at kemper.freedesktop.org
Thu May 3 05:12:46 PDT 2012


Module: telepathy-glib
Branch: master
Commit: f62c4d0445542287bb620a7708c9652161c5c9db
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=f62c4d0445542287bb620a7708c9652161c5c9db

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed May  2 20:34:15 2012 +0100

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 files 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);
 



More information about the telepathy-commits mailing list