提交 325eae3c authored 作者: Noel Grandin's avatar Noel Grandin

no need to construct a temporary for comparing

上级 d3c3192f
......@@ -1862,11 +1862,11 @@ public final class MVStore {
Collections.sort(old, new Comparator<Chunk>() {
@Override
public int compare(Chunk o1, Chunk o2) {
int comp = new Integer(o1.collectPriority).
compareTo(o2.collectPriority);
int comp = Integer.compare(o1.collectPriority,
o2.collectPriority);
if (comp == 0) {
comp = new Long(o1.maxLenLive).
compareTo(o2.maxLenLive);
comp = Long.compare(o1.maxLenLive,
o2.maxLenLive);
}
return comp;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论