From 6ec23dbb33ce40017e45df2bfc8b9a8b15f5783c Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 24 Mar 2011 17:33:10 -0400 Subject: SQlite store: Use g_list_prepend for performance --- telepathy-logger/log-store-sqlite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telepathy-logger/log-store-sqlite.c b/telepathy-logger/log-store-sqlite.c index f35d25e..dd1860d 100644 --- a/telepathy-logger/log-store-sqlite.c +++ b/telepathy-logger/log-store-sqlite.c @@ -692,7 +692,7 @@ _tpl_log_store_sqlite_get_pending_messages (TplLogStore *self, e = sqlite3_prepare_v2 (priv->db, "SELECT id,timestamp " "FROM pending_messages " "WHERE channel=? " - "ORDER BY id ASC", + "ORDER BY id DSC", -1, &sql, NULL); if (e != SQLITE_OK) @@ -721,7 +721,7 @@ _tpl_log_store_sqlite_get_pending_messages (TplLogStore *self, DEBUG (" - pending id=%u timestamp=%"G_GINT64_FORMAT, pending->id, pending->timestamp); - retval = g_list_append (retval, pending); + retval = g_list_prepend (retval, pending); } if (e != SQLITE_DONE) -- cgit v1.2.3