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