in hugegraph-common/src/main/java/org/apache/hugegraph/iterator/LimitIterator.java [39:56]
protected final boolean fetch() {
while (this.originIterator.hasNext()) {
T next = this.originIterator.next();
if (next == null) {
continue;
}
// Do filter
boolean reachLimit = this.filterCallback.apply(next);
if (reachLimit) {
this.closeOriginIterator();
return false;
}
assert this.current == none();
this.current = next;
return true;
}
return false;
}