aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-07-08 04:41:38 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-07-08 04:41:38 +0800
commit6b98af0d53275cf8003a9c6c55afd9bbe5d270d6 (patch)
tree54d9f91127c1ac0df9079d56664ad974a58f3097
parentd53fa6e296cba3fdd98db46e5efafbdf25c40c33 (diff)
downloadgsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar.gz
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar.bz2
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar.lz
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar.xz
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.tar.zst
gsoc2013-empathy-6b98af0d53275cf8003a9c6c55afd9bbe5d270d6.zip
Make empathy_contact_equal NULL-safe for the contact ID and use the ^ operator to concat 2 hashs values instead of +.
svn path=/trunk/; revision=1202
-rw-r--r--libempathy/empathy-contact.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index aee3fac5c..46aee93ea 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -718,7 +718,8 @@ empathy_contact_equal (gconstpointer v1,
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 @@ empathy_contact_hash (gconstpointer key)
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;