[telepathy-mission-control/master] _mcd_channel_details_build_from_list: hoist GType-generating call out of loop

Simon McVittie simon.mcvittie at collabora.co.uk
Mon Nov 2 07:18:10 PST 2009


---
 src/mcd-channel.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mcd-channel.c b/src/mcd-channel.c
index c08dfcb..4ee122b 100644
--- a/src/mcd-channel.c
+++ b/src/mcd-channel.c
@@ -1078,6 +1078,7 @@ _mcd_channel_details_build_from_list (const GList *channels)
 {
     GPtrArray *channel_array;
     const GList *list;
+    GType type = TP_STRUCT_TYPE_CHANNEL_DETAILS;
 
     channel_array = g_ptr_array_sized_new (g_list_length ((GList *) channels));
 
@@ -1086,11 +1087,9 @@ _mcd_channel_details_build_from_list (const GList *channels)
         McdChannel *channel = MCD_CHANNEL (list->data);
         GHashTable *properties;
         GValue channel_val = { 0, };
-        GType type;
 
         properties = _mcd_channel_get_immutable_properties (channel);
 
-        type = TP_STRUCT_TYPE_CHANNEL_DETAILS;
         g_value_init (&channel_val, type);
         g_value_take_boxed (&channel_val,
                             dbus_g_type_specialized_construct (type));
-- 
1.5.6.5




More information about the telepathy-commits mailing list