diff libpurple/protocols/oscar/visibility.c @ 31836:8d6630912021

Add two hash tables to the oscar code that deals with your server stored buddy list. One hash table is indexed by a combination of group id and buddy id. The other hash table is indexed by a combination of item type and item name. This should reduce the number of times we iterate through a linked list by A LOT. This is a modified version of Oliver's patch from #4816. Fixes #4816.
author Mark Doliner <mark@kingant.net>
date Sun, 20 Mar 2011 20:20:52 +0000
parents 1ade51ed363c
children
line wrap: on
line diff
--- a/libpurple/protocols/oscar/visibility.c	Sat Mar 19 19:38:55 2011 +0000
+++ b/libpurple/protocols/oscar/visibility.c	Sun Mar 20 20:20:52 2011 +0000
@@ -51,7 +51,7 @@
 static gboolean
 is_buddy_on_list(OscarData *od, const char *bname)
 {
-	return aim_ssi_itemlist_finditem(od->ssi.local, NULL, bname, get_buddy_list_type(od)) != NULL;
+	return aim_ssi_itemlist_finditem(&od->ssi.local, NULL, bname, get_buddy_list_type(od)) != NULL;
 }
 
 static void
@@ -102,7 +102,7 @@
 
 		buddy = cur->data;
 		bname = purple_buddy_get_name(buddy);
-		if (aim_ssi_itemlist_finditem(od->ssi.local, NULL, bname, list_type)) {
+		if (aim_ssi_itemlist_finditem(&od->ssi.local, NULL, bname, list_type)) {
 			filtered_buddies = g_slist_prepend(filtered_buddies, buddy);
 		}
 	}