[ 
https://issues.apache.org/jira/browse/TINKERPOP-3200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18031949#comment-18031949
 ] 

ASF GitHub Bot commented on TINKERPOP-3200:
-------------------------------------------

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


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatStep.java:
##########
@@ -206,25 +210,40 @@ protected Iterator<Traverser.Admin<S>> 
standardAlgorithm() throws NoSuchElementE
             throw new IllegalStateException("The repeat()-traversal was not 
defined: " + this);
 
         while (true) {
-            if (this.repeatTraversal.getEndStep().hasNext()) {
+            if (!first && this.repeatTraversal.getEndStep().hasNext()) {
                 return this.repeatTraversal.getEndStep();
             } else {
-                final Traverser.Admin<S> start = this.starts.next();
-                start.initialiseLoops(this.getId(), this.loopName);
-                if (doUntil(start, true)) {
-                    start.resetLoops();
-                    return IteratorUtils.of(start);
-                }
-                this.repeatTraversal.addStart(start);
-                if (doEmit(start, true)) {
-                    final Traverser.Admin<S> emitSplit = start.split();
-                    emitSplit.resetLoops();
-                    return IteratorUtils.of(emitSplit);
+                this.first = false;
+                if 
(!TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, 
repeatTraversal).isEmpty()) {

Review Comment:
   Would it be better to use `TraversalHelper. 
hasStepOfAssignableClassRecursively` so that it returns when a Barrier is first 
encountered instead of going through the entire traversal tree?





> Make repeat traversals completely global
> ----------------------------------------
>
>                 Key: TINKERPOP-3200
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3200
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: process
>    Affects Versions: 3.8.0
>            Reporter: Ken Hu
>            Priority: Blocker
>
> As described in the attached DISCUSS thread, repeat traversals are currently 
> a mix of local and global. Update this so the behavior is always global.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to