[PATCH] Use EpsilonComparator instead of redundant implementation
Wald Commits
scm-commit at wald.intevation.org
Tue Apr 7 11:20:40 CEST 2015
# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1428398436 -7200
# Node ID c9b8ad659d5b990f3e3c668f8d64ca8e540a693f
# Parent befa08182368ed35c84a8c061d20dcfea76c4a38
Use EpsilonComparator instead of redundant implementation.
diff -r befa08182368 -r c9b8ad659d5b artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Thu Apr 02 18:37:26 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java Tue Apr 07 11:20:36 2015 +0200
@@ -31,6 +31,8 @@
import gnu.trove.TDoubleArrayList;
+import static org.dive4elements.river.backend.utils.EpsilonComparator.CMP;
+
/**
* W, Q and km data from database 'wsts' spiced with interpolation algorithms.
*/
@@ -201,10 +203,7 @@
* Compare according to place of measurement (km).
*/
public int compareTo(Row other) {
- double d = km - other.km;
- if (d < -0.0001) return -1;
- if (d > 0.0001) return +1;
- return 0;
+ return CMP.compare(km, other.km);
}
/**
More information about the Dive4Elements-commits
mailing list