summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-20 14:14:06 (GMT)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-12-22 10:36:44 (GMT)
commitb65cff3d7e5f385546f1e201aeb2f94fcb9d2f45 (patch)
tree7e7c446558c7b0bc46cb569975ae643f28672dca
parent83979e241e70340a3a34e61e75ec175949ec9e68 (diff)
downloadtelepathy-glib-b65cff3d7e5f385546f1e201aeb2f94fcb9d2f45.tar.gz
telepathy-glib-b65cff3d7e5f385546f1e201aeb2f94fcb9d2f45.tar.xz
text-channel: don't define useless variables if debug is disabled
-rw-r--r--telepathy-glib/text-channel.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c
index 9eae11c..5d090a2 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);