You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by GitBox <gi...@apache.org> on 2022/01/28 12:23:16 UTC

[GitHub] [tinkerpop] divijvaidya commented on a change in pull request #1553: Gremlin Value Expressions 2.0 / Ternary Boolean Logics

divijvaidya commented on a change in pull request #1553:
URL: https://github.com/apache/tinkerpop/pull/1553#discussion_r794458616



##########
File path: gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndStep.java
##########
@@ -33,10 +34,18 @@ public AndStep(final Traversal.Admin traversal, final Traversal<S, ?>... travers
 
     @Override
     protected boolean filter(final Traverser.Admin<S> traverser) {
+        GremlinTypeErrorException typeError = null;
         for (final Traversal.Admin<S, ?> traversal : this.traversals) {
-            if (!TraversalUtil.test(traverser, traversal))
-                return false;
+            try {
+                if (!TraversalUtil.test(traverser, traversal))
+                    return false;
+            } catch (GremlinTypeErrorException ex) {
+                // hold onto it until the end in case any other arguments evaluate to FALSE

Review comment:
       I did not understand this. why not short circuit here? (given that the exception is converted to false anyways and the expression will always be false irrespective of the result of other traversals.)




-- 
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: commits-unsubscribe@tinkerpop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org