spmallette commented on code in PR #1929:
URL: https://github.com/apache/tinkerpop/pull/1929#discussion_r1063380893
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java:
##########
@@ -116,39 +120,64 @@ public S next() {
throw FastNoSuchElementException.instance();
return iterator.next();
}
+
+ @Override
+ public void close() {
+ CloseableIterator.closeIterator(iterator);
+ }
};
}
///////////////////
public static <T> boolean allMatch(final Iterator<T> iterator, final
Predicate<T> predicate) {
- while (iterator.hasNext()) {
- if (!predicate.test(iterator.next())) {
- return false;
+ try {
Review Comment:
could you explain this extra safety a bit please? were you running into some
scenario where the iterator was throwing an exception?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]