You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2015/06/22 17:41:45 UTC

incubator-tinkerpop git commit: minor simplification to MatchStep precompilation. No need to precheck start steps.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 727afc6bf -> 58830d811


minor simplification to MatchStep precompilation. No need to precheck start steps.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/58830d81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/58830d81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/58830d81

Branch: refs/heads/master
Commit: 58830d811a0ef3705157067a82c2cee84f9ca9ce
Parents: 727afc6
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Jun 22 09:41:41 2015 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Jun 22 09:41:41 2015 -0600

----------------------------------------------------------------------
 .../gremlin/process/traversal/step/map/MatchStep.java        | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/58830d81/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
index d522b0d..1ac0663 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/MatchStep.java
@@ -85,11 +85,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
                 this.traversal.addStep(new IdentityStep<>(this.traversal));
             this.traversal.getEndStep().addLabel(this.startKey);
         }
-        this.matchTraversals = (List) Stream.of(matchTraversals).map(Traversal::asAdmin).filter(t -> {
-            if (!TraversalHelper.getVariableLocations(t).contains(Variable.START))
-                throw new IllegalArgumentException("All match()-traversals must have a start label (i.e. variable): " + t);
-            return true;
-        }).collect(Collectors.toList());
+        this.matchTraversals = (List) Stream.of(matchTraversals).map(Traversal::asAdmin).collect(Collectors.toList());
         this.matchTraversals.forEach(this::configureStartAndEndSteps); // recursively convert to MatchStep, MatchStartStep, or MatchEndStep
         this.matchTraversals.forEach(this::integrateChild);
     }
@@ -124,7 +120,7 @@ public final class MatchStep<S, E> extends ComputerAwareStep<S, Map<String, E>>
                 }
             }
         } else {
-            TraversalHelper.insertBeforeStep(new MatchStartStep(matchTraversal, null), (Step) matchTraversal.getStartStep(), matchTraversal);
+            throw new IllegalArgumentException("All match()-traversals must have a start label (i.e. variable): " + matchTraversal);
         }
         // END STEP to XMatchEndStep
         final Step<?, ?> endStep = matchTraversal.getEndStep();