diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-04 12:26:54 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-12-04 12:26:54 +0000 |
commit | df4c3d4f5e57f12998dc6b47ef80b0a3204e49cd (patch) | |
tree | 2db059a1e29e4fde942d6ea4f1ea5c45272a3683 /telepathy-glib/properties-mixin.c | |
parent | db196d2f0cc5b92dabee0486bdfbd5bb86d1a600 (diff) | |
download | telepathy-glib-df4c3d4f5e57f12998dc6b47ef80b0a3204e49cd.tar.gz |
TpPropertiesMixin: simplify string comparison by using tp_strdiff
20071204122654-53eee-195f012b2148b22d34644ce6f10784c363147ce5.gz
Diffstat (limited to 'telepathy-glib/properties-mixin.c')
-rw-r--r-- | telepathy-glib/properties-mixin.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/telepathy-glib/properties-mixin.c b/telepathy-glib/properties-mixin.c index ea2e74225..cc6bf83ff 100644 --- a/telepathy-glib/properties-mixin.c +++ b/telepathy-glib/properties-mixin.c @@ -717,25 +717,13 @@ static gboolean values_are_equal (const GValue *v1, const GValue *v2) { GType type = G_VALUE_TYPE (v1); - const gchar *s1, *s2; switch (type) { case G_TYPE_BOOLEAN: return (g_value_get_boolean (v1) == g_value_get_boolean (v2)); case G_TYPE_STRING: - s1 = g_value_get_string (v1); - s2 = g_value_get_string (v2); - - /* are they both NULL? */ - if (s1 == s2) - return TRUE; - - /* is one of them NULL? */ - if (s1 == NULL || s2 == NULL) - return FALSE; - - return (strcmp (s1, s2) == 0); + return !tp_strdiff (g_value_get_string (v1), g_value_get_string (v2)); case G_TYPE_UINT: return (g_value_get_uint (v1) == g_value_get_uint (v2)); |