summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-24 17:43:12 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-25 14:03:36 -0400
commitd4bd574125fc1c8ad9e3a75e656cf245ccc52769 (patch)
treea346c6c6818edb56cb9dae0ea5ebcb49944cd7f3
parent6ec23dbb33ce40017e45df2bfc8b9a8b15f5783c (diff)
TextChannel: use g_list_prepend for performance
-rw-r--r--telepathy-logger/text-channel.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/telepathy-logger/text-channel.c b/telepathy-logger/text-channel.c
index f6b78df..ca7b2c9 100644
--- a/telepathy-logger/text-channel.c
+++ b/telepathy-logger/text-channel.c
@@ -494,7 +494,7 @@ on_pending_message_removed_cb (TpTextChannel *self,
GList *ids = NULL;
GError *error = NULL;
- ids = g_list_append (ids,
+ ids = g_list_prepend (ids,
GUINT_TO_POINTER (get_message_pending_id (TP_MESSAGE (message))));
cache = _tpl_log_store_sqlite_dup ();
@@ -572,7 +572,7 @@ pendingproc_store_pending_messages (TplActionChain *ctx,
if (cached_it == NULL)
{
/* No more cached pending, just log the pending messages */
- to_log = g_list_append (to_log, pending_it->data);
+ to_log = g_list_prepend (to_log, pending_it->data);
pending_it = g_list_next (pending_it);
continue;
}
@@ -582,7 +582,7 @@ pendingproc_store_pending_messages (TplActionChain *ctx,
if (pending_it == NULL)
{
/* No more pending, just remove the cached messages */
- to_remove = g_list_append (to_remove, GUINT_TO_POINTER (cached->id));
+ to_remove = g_list_prepend (to_remove, GUINT_TO_POINTER (cached->id));
cached_it = g_list_next (cached_it);
continue;
}
@@ -596,7 +596,7 @@ pendingproc_store_pending_messages (TplActionChain *ctx,
if (cached->timestamp != pending_ts)
{
/* The cache messaged is invalid, remove it */
- to_remove = g_list_append (to_remove,
+ to_remove = g_list_prepend (to_remove,
GUINT_TO_POINTER (cached->id));
cached_it = g_list_next (cached_it);
}
@@ -610,13 +610,13 @@ pendingproc_store_pending_messages (TplActionChain *ctx,
else if (cached->id < pending_id)
{
/* The cached ID is not valid anymore, remove it */
- to_remove = g_list_append (to_remove, GUINT_TO_POINTER (cached->id));
+ to_remove = g_list_prepend (to_remove, GUINT_TO_POINTER (cached->id));
cached_it = g_list_next (cached_it);
}
else if (cached->id < pending_id)
{
/* The pending message has not been logged */
- to_log = g_list_append (to_log, pending);
+ to_log = g_list_prepend (to_log, pending);
pending_it = g_list_next (pending_it);
}
}