From bea8bf6254665e7a5d38f0f84dbcdab8c4c5015d Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Mon, 12 Sep 2011 18:04:08 +0200 Subject: Replace callers of getDistance() by a direct call --- src/cgeo/geocaching/cgDistanceView.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/cgeo/geocaching/cgDistanceView.java') diff --git a/src/cgeo/geocaching/cgDistanceView.java b/src/cgeo/geocaching/cgDistanceView.java index ae9e7b7..2e17247 100644 --- a/src/cgeo/geocaching/cgDistanceView.java +++ b/src/cgeo/geocaching/cgDistanceView.java @@ -27,11 +27,10 @@ public class cgDistanceView extends TextView { } public void update(final Geopoint coords) { - if (cacheCoords == null) return; - if (coords == null) return; - if (base == null) return; - - setText(base.getHumanDistance(cgBase.getDistance(coords, cacheCoords))); + if (cacheCoords == null || coords == null || base == null) { + return; + } + setText(base.getHumanDistance(coords.distanceTo(cacheCoords))); } public void setDistance(Double distance) { -- cgit v1.1