Skip to content

Commit

Permalink
Correcting improper use of Java 7 API
Browse files Browse the repository at this point in the history
  • Loading branch information
pwoodworth committed Sep 26, 2013
1 parent 869f664 commit 32c66e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/turn/ttorrent/client/Piece.java
Expand Up @@ -276,11 +276,11 @@ public String toString() {
* @param other The piece to compare with, should not be <em>null</em>.
*/
public int compareTo(Piece other) {
int retval = Integer.compare(this.seen, other.seen);
if (retval == 0) {
retval = Integer.compare(this.index, other.index);
if (this.seen != other.seen) {
return this.seen < other.seen ? -1 : 1;
}
return retval;
return this.index == other.index ? 0 :
(this.index < other.index ? -1 : 1);
}

/**
Expand Down

0 comments on commit 32c66e1

Please sign in to comment.