fix GroupConsumeInfo#compareTo (#326)

This commit is contained in:
James Yin
2020-08-04 17:32:32 +08:00
committed by GitHub
parent 970e718413
commit 3c32be5ace

View File

@@ -71,10 +71,9 @@ public class GroupConsumeInfo implements Comparable<GroupConsumeInfo> {
@Override @Override
public int compareTo(GroupConsumeInfo o) { public int compareTo(GroupConsumeInfo o) {
if (this.count != o.count) { if (this.count != o.count) {
return o.count - this.count; return Integer.compare(o.count, this.count);
} }
return Long.compare(o.diffTotal, this.diffTotal);
return (int) (o.diffTotal - diffTotal);
} }
public int getConsumeTps() { public int getConsumeTps() {