提交 07e12670 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use Collections.emptyIterator()

上级 07e67c2d
...@@ -491,8 +491,7 @@ public class PageDataIndex extends PageIndex { ...@@ -491,8 +491,7 @@ public class PageDataIndex extends PageIndex {
Iterator<Row> getDelta() { Iterator<Row> getDelta() {
if (delta == null) { if (delta == null) {
List<Row> e = Collections.emptyList(); return Collections.emptyIterator();
return e.iterator();
} }
return delta.iterator(); return delta.iterator();
} }
......
...@@ -251,8 +251,7 @@ public class ScanIndex extends BaseIndex { ...@@ -251,8 +251,7 @@ public class ScanIndex extends BaseIndex {
Iterator<Row> getDelta() { Iterator<Row> getDelta() {
if (delta == null) { if (delta == null) {
List<Row> e = Collections.emptyList(); return Collections.emptyIterator();
return e.iterator();
} }
return delta.iterator(); return delta.iterator();
} }
......
...@@ -258,7 +258,7 @@ public class MVPrimaryIndex extends BaseIndex { ...@@ -258,7 +258,7 @@ public class MVPrimaryIndex extends BaseIndex {
ValueLong v = (ValueLong) (first ? map.firstKey() : map.lastKey()); ValueLong v = (ValueLong) (first ? map.firstKey() : map.lastKey());
if (v == null) { if (v == null) {
return new MVStoreCursor(session, return new MVStoreCursor(session,
Collections.<Entry<Value, Value>> emptyList().iterator()); Collections.<Entry<Value, Value>> emptyIterator());
} }
Value value = map.get(v); Value value = map.get(v);
Entry<Value, Value> e = new AbstractMap.SimpleImmutableEntry<Value, Value>(v, value); Entry<Value, Value> e = new AbstractMap.SimpleImmutableEntry<Value, Value>(v, value);
......
...@@ -307,7 +307,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -307,7 +307,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
} }
if (min == null) { if (min == null) {
return new MVStoreCursor(session, return new MVStoreCursor(session,
Collections.<Value>emptyList().iterator(), null); Collections.<Value>emptyIterator(), null);
} }
} }
return new MVStoreCursor(session, map.keyIterator(min), last); return new MVStoreCursor(session, map.keyIterator(min), last);
...@@ -394,7 +394,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex { ...@@ -394,7 +394,7 @@ public final class MVSecondaryIndex extends BaseIndex implements MVIndex {
while (true) { while (true) {
if (key == null) { if (key == null) {
return new MVStoreCursor(session, return new MVStoreCursor(session,
Collections.<Value>emptyList().iterator(), null); Collections.<Value>emptyIterator(), null);
} }
if (((ValueArray) key).getList()[0] != ValueNull.INSTANCE) { if (((ValueArray) key).getList()[0] != ValueNull.INSTANCE) {
break; break;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论