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


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/RangeGlobalStep.java:
##########
@@ -55,40 +64,72 @@ public RangeGlobalStep(final Traversal.Admin traversal, 
final long low, final lo
     protected boolean filter(final Traverser.Admin<S> traverser) {
         if (this.bypass) return true;
 
-        if (this.high != -1 && this.counter.get() >= this.high) {
+        final String counterKey = getCounterKey(traverser);
+        final AtomicLong counter = counters.computeIfAbsent(counterKey, k -> 
new AtomicLong(0L));
+
+        if (this.high != -1 && counter.get() >= this.high) {
+            if (this.getTraversal().getParent() instanceof RepeatStep) {

Review Comment:
   I've changed the check to move upwards until the root and added feature test 
for limit in union in repeat. I prefer to leave the check in to reduce 
potential backwards compatibility breakage since we know something is going 
wrong with the Paths.feature test when it is removed.



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