[evolution-data-server] Bug 687694 - imapx_untagged_vanished() is inefficient



commit ffd4d6931fd5af8624610825dd026139a6926a38
Author: Dan Williams <dcbw redhat com>
Date:   Wed Nov 7 06:59:51 2012 -0500

    Bug 687694 - imapx_untagged_vanished() is inefficient
    
    For uid->len = 318320, timing the loop yields:
    
    g_list_append(): 60+ seconds
    g_list_prepend(): 0.3 seconds

 camel/camel-imapx-server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index 6de71d6..a265838 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -1518,9 +1518,10 @@ imapx_untagged_vanished (CamelIMAPXServer *is,
 
 		c (is->tagprefix, "vanished: %s\n", uid);
 
-		uid_list = g_list_append (uid_list, uid);
+		uid_list = g_list_prepend (uid_list, uid);
 		camel_folder_change_info_remove_uid (is->changes, uid);
 	}
+	uid_list = g_list_reverse (uid_list);
 	camel_folder_summary_remove_uids (is->select_folder->summary, uid_list);
 	is->expunged = g_list_concat (is->expunged, uid_list);
 	g_ptr_array_free (uids, FALSE);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]