diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-12-20 15:14:06 +0100 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-12-22 11:36:44 +0100 |
commit | b65cff3d7e5f385546f1e201aeb2f94fcb9d2f45 (patch) | |
tree | 7e7c446558c7b0bc46cb569975ae643f28672dca | |
parent | 83979e241e70340a3a34e61e75ec175949ec9e68 (diff) |
text-channel: don't define useless variables if debug is disabled
-rw-r--r-- | telepathy-glib/text-channel.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c index 9eae11cc6..5d090a2d0 100644 --- a/telepathy-glib/text-channel.c +++ b/telepathy-glib/text-channel.c @@ -380,16 +380,19 @@ got_sender_contact_by_id_cb (TpConnection *connection, } else if (n_contacts != 1) { - GHashTableIter iter; - gpointer key, value; - - g_hash_table_iter_init (&iter, failed_id_errors); - while (g_hash_table_iter_next (&iter, &key, &value)) + if (DEBUGGING) { - const gchar *id = key; - GError *err = value; + GHashTableIter iter; + gpointer key, value; - DEBUG ("Failed to get a TpContact for %s: %s", id, err->message); + g_hash_table_iter_init (&iter, failed_id_errors); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + const gchar *id = key; + GError *err = value; + + DEBUG ("Failed to get a TpContact for %s: %s", id, err->message); + } } sender = contacts[0]; @@ -594,8 +597,6 @@ got_pending_senders_contact_by_id_cb (TpConnection *connection, { TpTextChannel *self = (TpTextChannel *) weak_object; GList *parts_list = user_data; - GHashTableIter iter; - gpointer key, value; if (error != NULL) { @@ -603,13 +604,19 @@ got_pending_senders_contact_by_id_cb (TpConnection *connection, goto out; } - g_hash_table_iter_init (&iter, failed_id_errors); - while (g_hash_table_iter_next (&iter, &key, &value)) + if (DEBUGGING) { - const gchar *id = key; - GError *err = value; + GHashTableIter iter; + gpointer key, value; + + g_hash_table_iter_init (&iter, failed_id_errors); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + const gchar *id = key; + GError *err = value; - DEBUG ("Failed to get a TpContact for %s: %s", id, err->message); + DEBUG ("Failed to get a TpContact for %s: %s", id, err->message); + } } got_pending_senders_contact (self, parts_list, n_contacts, contacts); |