changeset 11866:2bee8d023e23

[gaim-migrate @ 14157] A list optimization I missed before. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 27 Oct 2005 21:30:22 +0000
parents ccd53adabf6c
children ff02464a079f
files src/conversation.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Thu Oct 27 21:21:55 2005 +0000
+++ b/src/conversation.c	Thu Oct 27 21:30:22 2005 +0000
@@ -1488,7 +1488,8 @@
 		cb = gaim_conv_chat_cb_new(user, flags);
 		gaim_conv_chat_set_users(chat,
 				g_list_prepend(gaim_conv_chat_get_users(chat), cb));
-		aliases = g_list_append(aliases, (char *)alias);
+		/* We reverse this later to keep it in the same order as users. */
+		aliases = g_list_prepend(aliases, (char *)alias);
 
 		if (!quiet && new_arrivals) {
 			char *tmp;
@@ -1511,6 +1512,10 @@
 			extra_msgs = extra_msgs->next;
 	}
 
+	/* This needs to be in the same order as users, but it's faster
+	 * to prepend, so we do that above. */
+	aliases = g_list_reverse(aliases);
+
 	if (ops != NULL && ops->chat_add_users != NULL)
 		ops->chat_add_users(conv, users, aliases);