imbajin commented on code in PR #3039:
URL: https://github.com/apache/hugegraph/pull/3039#discussion_r3336164034


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/traversal/optimize/TraversalUtil.java:
##########
@@ -179,7 +193,142 @@ public static void extractHasContainer(HugeGraphStep<?, 
?> newStep,
                 TraversalHelper.copyLabels(step, step.getPreviousStep(), 
false);
                 traversal.removeStep(step);
             }
-        } while (step instanceof HasStep || step instanceof NoOpBarrierStep);
+            step = nextStep;
+        }
+    }
+
+    private static boolean followedByMatchStep(Step<?, ?> step) {
+        Step<?, ?> next = step.getNextStep();
+        while (next instanceof HasStep || next instanceof NoOpBarrierStep) {

Review Comment:
   ‼️ **Treat transparent steps before `match()` consistently**
   
   `followedByMatchStep()` only skips `HasStep` and `NoOpBarrierStep`, so a 
traversal like `g.V().has("vp4", P.neq("J2O")).identity().match(...)` no longer 
looks match-adjacent here and the unsafe range/neq predicate can still be 
extracted into `HugeGraphStep`. Other extraction paths in this file already 
treat `IdentityStep` as transparent, so please skip it here too and add a 
regression with an intervening `identity()` before `match()`.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to