From 2f903a12fcb61a25fe744680ffa3b2060ab1c009 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Fri, 10 Jan 2014 11:47:20 +0100 Subject: Simplify comparison implementation This was triggered by issue #3532. The comparator interface could return the following facts simultaneously A == B, A == C, B < C if A could not be compared to others. Now we will have A placed after B and C in any case. Also, since most comparators can compare all caches, the defalut is true and can be overriden if needed. --- main/src/cgeo/geocaching/sorting/StateComparator.java | 5 ----- 1 file changed, 5 deletions(-) (limited to 'main/src/cgeo/geocaching/sorting/StateComparator.java') diff --git a/main/src/cgeo/geocaching/sorting/StateComparator.java b/main/src/cgeo/geocaching/sorting/StateComparator.java index b99c3c0..9488bd9 100644 --- a/main/src/cgeo/geocaching/sorting/StateComparator.java +++ b/main/src/cgeo/geocaching/sorting/StateComparator.java @@ -9,11 +9,6 @@ import cgeo.geocaching.Geocache; public class StateComparator extends AbstractCacheComparator { @Override - protected boolean canCompare(final Geocache cache1, final Geocache cache2) { - return true; - } - - @Override protected int compareCaches(final Geocache cache1, final Geocache cache2) { return getState(cache1) - getState(cache2); } -- cgit v1.1