pidgin: aa2263fd: Better hash function for the PurpleBuddy...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Jul 16 16:25:21 EDT 2009


-----------------------------------------------------------------
Revision: aa2263fd0818d5900ddd12e42fd72e05c2eca3bc
Ancestor: 7aa70485002618c0d25120a152aec4f6a3b74ccf
Author: darkrain42 at pidgin.im
Date: 2009-07-16T20:22:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/aa2263fd0818d5900ddd12e42fd72e05c2eca3bc

Modified files:
        libpurple/blist.c

ChangeLog: 

Better hash function for the PurpleBuddy lookup hashtables.

-------------- next part --------------
============================================================
--- libpurple/blist.c	1b48e33afe89b7fa65c5aa18a181d3a084ad597b
+++ libpurple/blist.c	0b359b0654019c09bafa13d9c75f326e7eca2aba
@@ -92,7 +92,7 @@ static guint _purple_blist_hbuddy_hash(s
 /* This function must not use purple_normalize */
 static guint _purple_blist_hbuddy_hash(struct _purple_hbuddy *hb)
 {
-	return g_str_hash(hb->name);
+	return g_str_hash(hb->name) ^ g_direct_hash(hb->group) ^ g_direct_hash(hb->account);
 }
 
 /* This function must not use purple_normalize */


More information about the Commits mailing list