TINKERPOP-1642 Removed some extra iteration in Parameters.getTraversals()
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/149a6f8b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/149a6f8b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/149a6f8b Branch: refs/heads/TINKERPOP-1642 Commit: 149a6f8bbb98360357d6099f8324ec4c53ba622a Parents: 5061c47 Author: Stephen Mallette <sp...@genoprime.com> Authored: Fri Mar 10 12:31:38 2017 -0500 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Mon Mar 20 14:09:02 2017 -0400 ---------------------------------------------------------------------- .../gremlin/process/traversal/step/util/Parameters.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/149a6f8b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java ---------------------------------------------------------------------- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java index 6640e87..93cf1f8 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/Parameters.java @@ -54,7 +54,7 @@ public final class Parameters implements Cloneable, Serializable { * {@link #set(Object...)} because when the parameter map is large the cost of iterating it repeatedly on the * high number of calls to {@link #getTraversals()} and {@link #integrateTraversals(TraversalParent)} is great. */ - private List<Traversal.Admin> traversals = new ArrayList<>(); + private List<Traversal.Admin<?,?>> traversals = new ArrayList<>(); /** * Checks for existence of key in parameter set. @@ -203,11 +203,7 @@ public final class Parameters implements Cloneable, Serializable { */ public <S, E> List<Traversal.Admin<S, E>> getTraversals() { // stupid generics - just need to return "traversals" - final List<Traversal.Admin<S, E>> result = new ArrayList<>(); - for (Traversal.Admin t : traversals) { - result.add(t); - } - return result; + return (List<Traversal.Admin<S, E>>) (Object) traversals; } public Parameters clone() {