andreachild commented on code in PR #3248:
URL: https://github.com/apache/tinkerpop/pull/3248#discussion_r2467531060


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/TailGlobalStep.java:
##########
@@ -58,9 +59,13 @@ public Traverser.Admin<S> processNextStart() {
             // If we are bypassing this step, let everything through.
             return this.starts.next();
         } else {
+            if (this.tail.isEmpty()) {
+                consuming = true;
+            }
             // Pull everything available before we start delivering from the 
tail buffer.
-            if (this.starts.hasNext()) {
+            if (consuming && this.starts.hasNext()) {
                 this.starts.forEachRemaining(this::addTail);
+                consuming = false;

Review Comment:
   Can this be replaced with just a check for `tail.isEmpty()`?
   ```suggestion
               if (this.tail.isEmpty() && this.starts.hasNext()) {
   this.starts.forEachRemaining(this::addTail);
   ```



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