Skip to content

Commit 88f8e47

Browse files
authored
Merge pull request #925 from MaxGreil/GithubIssue864
Fix issue 864
2 parents dfd1542 + 6e3627f commit 88f8e47

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
@@ -43,20 +43,15 @@ public int compare(AlternativeAlignment a, AlternativeAlignment b) {
4343

4444
if ( s1 > s2)
4545
return 1;
46-
if ( s1 < s2)
46+
else if ( s1 < s2)
4747
return -1;
48+
else {
49+
// seem to have the same length
50+
double rms1 = a.getRmsd();
51+
double rms2 = b.getRmsd();
52+
return Double.compare(rms1, rms2);
53+
}
4854

49-
// seem to have the same length
50-
51-
double rms1 = a.getRmsd();
52-
double rms2 = b.getRmsd();
53-
54-
if ( rms1 < rms2)
55-
return 1;
56-
if ( rms1 < rms2)
57-
return -1;
58-
59-
return 0;
6055
}
6156

6257

0 commit comments

Comments
 (0)