comparison src/conversation.c @ 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 648637d0a931
children 3ba50c385299
comparison
equal deleted inserted replaced
11865:ccd53adabf6c 11866:2bee8d023e23
1486 gaim_conv_chat_is_user_ignored(chat, user); 1486 gaim_conv_chat_is_user_ignored(chat, user);
1487 1487
1488 cb = gaim_conv_chat_cb_new(user, flags); 1488 cb = gaim_conv_chat_cb_new(user, flags);
1489 gaim_conv_chat_set_users(chat, 1489 gaim_conv_chat_set_users(chat,
1490 g_list_prepend(gaim_conv_chat_get_users(chat), cb)); 1490 g_list_prepend(gaim_conv_chat_get_users(chat), cb));
1491 aliases = g_list_append(aliases, (char *)alias); 1491 /* We reverse this later to keep it in the same order as users. */
1492 aliases = g_list_prepend(aliases, (char *)alias);
1492 1493
1493 if (!quiet && new_arrivals) { 1494 if (!quiet && new_arrivals) {
1494 char *tmp; 1495 char *tmp;
1495 1496
1496 if (extra_msg == NULL) 1497 if (extra_msg == NULL)
1508 ul = ul->next; 1509 ul = ul->next;
1509 fl = fl->next; 1510 fl = fl->next;
1510 if (extra_msgs != NULL) 1511 if (extra_msgs != NULL)
1511 extra_msgs = extra_msgs->next; 1512 extra_msgs = extra_msgs->next;
1512 } 1513 }
1514
1515 /* This needs to be in the same order as users, but it's faster
1516 * to prepend, so we do that above. */
1517 aliases = g_list_reverse(aliases);
1513 1518
1514 if (ops != NULL && ops->chat_add_users != NULL) 1519 if (ops != NULL && ops->chat_add_users != NULL)
1515 ops->chat_add_users(conv, users, aliases); 1520 ops->chat_add_users(conv, users, aliases);
1516 1521
1517 g_list_free(aliases); 1522 g_list_free(aliases);