changed order for compare instead of negating result (Spotbugs RV_NEGATING_RESULT_OF_COMPARETO)

This commit is contained in:
Stefan Spieker committed 2019-09-29 10:51:34 +02:00
1 parent 22222f4c69
commit d408627e9f
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -1059,8 +1059,8 @@ public class Functions {
}
public int compareTo(Tag that) {
int r = Double.compare(this.ordinal, that.ordinal);
if (r!=0) return -r; // descending for ordinal
int r = Double.compare(that.ordinal, this.ordinal);
if (r!=0) return r; // descending for ordinal by reversing the order for compare
return this.hierarchy.compareTo(that.hierarchy);
}
}