FlorianHockmann commented on a change in pull request #1502:
URL: https://github.com/apache/tinkerpop/pull/1502#discussion_r756166726



##########
File path: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversal.java
##########
@@ -193,7 +193,9 @@ public void applyStrategies() throws IllegalStateException {
     @Override
     public boolean hasNext() {
         if (!this.locked) this.applyStrategies();
-        return this.lastTraverser.bulk() > 0L || this.finalEndStep.hasNext();
+        final boolean more = this.lastTraverser.bulk() > 0L || 
this.finalEndStep.hasNext();
+        if (!more) CloseableIterator.closeIterator(this);

Review comment:
       Just a comprehension question: Why does it make sense to close the 
iterator for `hasNext()`, but not do the same for the other terminal steps?




-- 
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]


Reply via email to