Skip to content

Commit

Permalink
Fix comparison crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Chion82 committed Mar 28, 2016
1 parent 35ca23c commit 1f8be0e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions app/src/main/java/moe/chionlab/wechatmomentstat/SnsStat.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,25 @@ public int compare(UserSnsInfo lhs, UserSnsInfo rhs) {
Collections.sort(heatRank, new Comparator<UserSnsInfo>() {
@Override
public int compare(UserSnsInfo lhs, UserSnsInfo rhs) {
return (rhs.heatRate - lhs.heatRate)>0?1:-1;
if (rhs.heatRate - lhs.heatRate > 0) {
return 1;
} else if (rhs.heatRate - lhs.heatRate < 0) {
return -1;
} else {
return 0;
}
}
});
Collections.sort(coldRank, new Comparator<UserSnsInfo>() {
@Override
public int compare(UserSnsInfo lhs, UserSnsInfo rhs) {
return (lhs.heatRate - rhs.heatRate)>0?1:-1;
if (lhs.heatRate - rhs.heatRate > 0) {
return 1;
} else if (lhs.heatRate - rhs.heatRate < 0) {
return -1;
} else {
return 0;
}
}
});
}
Expand Down

0 comments on commit 1f8be0e

Please sign in to comment.