[empathy] map_view_update_contact_position: don't call contact_has_location twice
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] map_view_update_contact_position: don't call contact_has_location twice
- Date: Tue, 30 Mar 2010 11:36:14 +0000 (UTC)
commit 7e082683ab606d1521fbbaa7dffd75efe7395e20
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Fri Mar 26 15:59:53 2010 +0100
map_view_update_contact_position: don't call contact_has_location twice
src/empathy-map-view.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index b14a572..e5240cb 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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]