changeset 27705:12ab4c1112e5

Optimize blist searching with lots and lots of empty groups committer: Paul Aurich <paul@darkrain42.org>
author aman@tmm1.net
date Mon, 27 Jul 2009 22:02:20 +0000
parents 14ce47859540
children b6f26015c51c
files libpurple/blist.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Mon Jul 27 05:20:52 2009 +0000
+++ b/libpurple/blist.c	Mon Jul 27 22:02:20 2009 +0000
@@ -2432,6 +2432,9 @@
 	hb.name = (gchar *)purple_normalize(account, name);
 
 	for (group = purplebuddylist->root; group; group = group->next) {
+		if (!group->child)
+			continue;
+
 		hb.group = group;
 		if ((buddy = g_hash_table_lookup(purplebuddylist->buddies, &hb))) {
 			return buddy;
@@ -2481,6 +2484,9 @@
 		hb.account = account;
 
 		for (node = purplebuddylist->root; node != NULL; node = node->next) {
+			if (!node->child)
+				continue;
+
 			hb.group = node;
 			if ((buddy = g_hash_table_lookup(purplebuddylist->buddies, &hb)) != NULL)
 				ret = g_slist_prepend(ret, buddy);