mikepersonick commented on code in PR #1929:
URL: https://github.com/apache/tinkerpop/pull/1929#discussion_r1063488308
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/util/iterator/IteratorUtils.java:
##########
@@ -163,6 +192,7 @@ public static <K, S, V> Map<K, V> collectMap(final
Iterator<S> iterator, final F
final S obj = iterator.next();
map.put(key.apply(obj), value.apply(obj));
}
+ CloseableIterator.closeIterator(iterator);
Review Comment:
All these methods reduce the nested iterator to a single result and then
discard it. I am just making sure they close their delegate properly, otherwise
we get resource leaks (especially if the underlying iterator is something that
actually holds resources open, like a Traversal).
--
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]