Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replaced subtraction based comparator. This comparator is unlikely to…
… overflow but the safety of using the equalities ensures the proper behaviour of this comparator.

Change-Id: I4cf311f327e53754e189c5734147a245446495ac
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Dec 12, 2012
1 parent 425c795 commit e5b1bc6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/org/openscience/cdk/smsd/ring/RingFilter.java
Expand Up @@ -121,7 +121,11 @@ private class RingSizeComparator implements Comparator<List<?>> {
* {@inheritDoc}
*/
public int compare(List<?> o1, List<?> o2) {
return o1.size() - o2.size();
if(o1.size() > o2.size())
return +1;
if(o1.size() < o2.size())
return -1;
return 0;
}
}
}

0 comments on commit e5b1bc6

Please sign in to comment.