提交 912abcb3 authored 作者: andrei's avatar andrei

code review

上级 17dcd2eb
......@@ -1743,9 +1743,7 @@ public final class MVStore {
Collections.sort(move, new Comparator<Chunk>() {
@Override
public int compare(Chunk o1, Chunk o2) {
int res = Long.signum(o1.block - o2.block);
assert res == Long.compare(o1.block, o2.block);
return res;
return Long.compare(o1.block, o2.block);
}
});
// find which is the last block to keep
......@@ -1949,11 +1947,9 @@ public final class MVStore {
Collections.sort(old, new Comparator<Chunk>() {
@Override
public int compare(Chunk o1, Chunk o2) {
int comp = Integer.compare(o1.collectPriority,
o2.collectPriority);
int comp = Integer.compare(o1.collectPriority, o2.collectPriority);
if (comp == 0) {
comp = Long.compare(o1.maxLenLive,
o2.maxLenLive);
comp = Long.compare(o1.maxLenLive, o2.maxLenLive);
}
return comp;
}
......
......@@ -565,7 +565,6 @@ public abstract class Page implements Cloneable
*/
public abstract void insertNode(int index, Object key, Page childPage);
@SuppressWarnings("SuspiciousSystemArraycopy")
final void insertKey(int index, Object key) {
int keyCount = getKeyCount();
assert index <= keyCount : index + " > " + keyCount;
......@@ -1285,7 +1284,6 @@ public abstract class Page implements Cloneable
}
@Override
@SuppressWarnings("SuspiciousSystemArraycopy")
public void insertLeaf(int index, Object key, Object value) {
int keyCount = getKeyCount();
insertKey(index, key);
......
......@@ -48,7 +48,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
}
@Override
@SuppressWarnings("unchecked")
public V get(Object key) {
V result = get(getRootPage(), key);
return result;
......@@ -130,7 +129,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
* @return the old value if the key existed, or null otherwise
*/
@Override
@SuppressWarnings("unchecked")
public V remove(Object key) {
return operate((SpatialKey) key, null, DecisionMaker.REMOVE);
}
......@@ -295,7 +293,6 @@ public final class MVRTreeMap<V> extends MVMap<SpatialKey, V> {
}
@Override
@SuppressWarnings("unchecked")
public V put(SpatialKey key, V value) {
return operate(key, value, DecisionMaker.PUT);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论