Skip to content

Commit 6e3627f

Browse files
committed
Fix issue 864
1 parent 1580867 commit 6e3627f

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/AltAligComparator.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,15 @@ public int compare(AlternativeAlignment a, AlternativeAlignment b) {
4848

4949
if ( s1 > s2)
5050
return 1;
51-
if ( s1 < s2)
51+
else if ( s1 < s2)
5252
return -1;
53+
else {
54+
// seem to have the same length
55+
double rms1 = a.getRmsd();
56+
double rms2 = b.getRmsd();
57+
return Double.compare(rms1, rms2);
58+
}
5359

54-
// seem to have the same length
55-
56-
double rms1 = a.getRmsd();
57-
double rms2 = b.getRmsd();
58-
59-
if ( rms1 < rms2)
60-
return 1;
61-
if ( rms1 < rms2)
62-
return -1;
63-
64-
return 0;
6560
}
6661

6762

0 commit comments

Comments
 (0)