empathy r1202 - trunk/libempathy



Author: xclaesse
Date: Mon Jul  7 20:41:38 2008
New Revision: 1202
URL: http://svn.gnome.org/viewvc/empathy?rev=1202&view=rev

Log:
Make empathy_contact_equal NULL-safe for the contact ID and use the ^ operator to concat 2 hashs values instead of +.


Modified:
   trunk/libempathy/empathy-contact.c

Modified: trunk/libempathy/empathy-contact.c
==============================================================================
--- trunk/libempathy/empathy-contact.c	(original)
+++ trunk/libempathy/empathy-contact.c	Mon Jul  7 20:41:38 2008
@@ -718,7 +718,8 @@
 	id_a = empathy_contact_get_id (EMPATHY_CONTACT (v1));
 	id_b = empathy_contact_get_id (EMPATHY_CONTACT (v2));
 
-	return empathy_account_equal (account_a, account_b) && g_str_equal (id_a, id_b);
+	return empathy_account_equal (account_a, account_b) &&
+	       !tp_strdiff (id_a, id_b);
 }
 
 guint
@@ -731,7 +732,8 @@
 	priv = GET_PRIV (EMPATHY_CONTACT (key));
 
 	if (priv->hash == 0) {
-		priv->hash = empathy_account_hash (priv->account) + g_str_hash (priv->id);
+		priv->hash = empathy_account_hash (priv->account) ^
+			     g_str_hash (priv->id);
 	}
 
 	return priv->hash;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]