From 7e082683ab606d1521fbbaa7dffd75efe7395e20 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 26 Mar 2010 15:59:53 +0100 Subject: map_view_update_contact_position: don't call contact_has_location twice --- src/empathy-map-view.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c index b14a57273..e5240cb9c 100644 --- a/src/empathy-map-view.c +++ b/src/empathy-map-view.c @@ -98,24 +98,26 @@ map_view_update_contact_position (EmpathyMapView *self, GValue *value; GHashTable *location; ChamplainMarker *marker; + gboolean has_location; + + has_location = contact_has_location (contact); marker = g_hash_table_lookup (self->markers, contact); if (marker == NULL) { - if (!contact_has_location (contact)) + if (!has_location) return; marker = create_marker (self, contact); } - - location = empathy_contact_get_location (contact); - - if (!contact_has_location (contact)) + else if (!has_location) { champlain_base_marker_animate_out (CHAMPLAIN_BASE_MARKER (marker)); return; } + location = empathy_contact_get_location (contact); + value = g_hash_table_lookup (location, EMPATHY_LOCATION_LAT); if (value == NULL) { -- cgit v1.2.3