aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2013-05-18 21:00:48 +0200
committerSamuel Tardieu <sam@rfc1149.net>2013-05-18 21:02:15 +0200
commit37c0049a5525e49d45ff69c671da900a8389816a (patch)
tree9e902a8e85498156e2882e3b7a2060c01da44c79 /main/src
parenta417f690148b09fd9b3fe7ea7e7b64714791fa74 (diff)
downloadcgeo-37c0049a5525e49d45ff69c671da900a8389816a.zip
cgeo-37c0049a5525e49d45ff69c671da900a8389816a.tar.gz
cgeo-37c0049a5525e49d45ff69c671da900a8389816a.tar.bz2
fix: do not reset the distance in the distance comparator
The distance comparator should not override a distance that can have been obtained from the website and that we are unable to recompute locally (because we don't know the cache coordinates for example). Part of work on #2733.
Diffstat (limited to 'main/src')
-rw-r--r--main/src/cgeo/geocaching/sorting/DistanceComparator.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/main/src/cgeo/geocaching/sorting/DistanceComparator.java b/main/src/cgeo/geocaching/sorting/DistanceComparator.java
index 7b0afbb..c34ae96 100644
--- a/main/src/cgeo/geocaching/sorting/DistanceComparator.java
+++ b/main/src/cgeo/geocaching/sorting/DistanceComparator.java
@@ -27,13 +27,10 @@ public class DistanceComparator extends AbstractCacheComparator {
if (cachedDistances) {
return;
}
- for (Geocache cache : list) {
+ for (final Geocache cache : list) {
if (cache.getCoords() != null) {
cache.setDistance(coords.distanceTo(cache.getCoords()));
}
- else {
- cache.setDistance(null);
- }
}
cachedDistances = true;
}