kenhuuu commented on code in PR #3247:
URL: https://github.com/apache/tinkerpop/pull/3247#discussion_r2452467520
##########
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:
Yea, that would be better. Thanks for pointing this out.
--
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]