tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [12/13] tinkerpop git commit: TINKERPOP-1686 Minor refactoring - changed looping structure
Date Thu, 13 Jul 2017 10:18:33 GMT
TINKERPOP-1686 Minor refactoring - changed looping structure


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

Branch: refs/heads/master
Commit: 6465fd97c617d438cf3ba8338144e4808fba4534
Parents: 85dc8a9
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Wed Jul 12 19:36:13 2017 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Wed Jul 12 19:36:13 2017 -0400

----------------------------------------------------------------------
 .../process/traversal/util/DefaultTraversalMetrics.java       | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6465fd97/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
index 6053c9c..ae0bd8e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/DefaultTraversalMetrics.java
@@ -77,9 +77,10 @@ public final class DefaultTraversalMetrics implements TraversalMetrics,
Serializ
      */
     public DefaultTraversalMetrics(final long totalStepDurationNs, final List<MutableMetrics>
orderedMetrics) {
         totalStepDuration = totalStepDurationNs;
-        for (int ix = 0; ix < orderedMetrics.size(); ix++) {
-            stepIndexedMetrics.put(orderedMetrics.get(ix).getId(), orderedMetrics.get(ix).getImmutableClone());
-            positionIndexedMetrics.put(ix, orderedMetrics.get(ix).getImmutableClone());
+        int ix = 0;
+        for (final MutableMetrics metric : orderedMetrics) {
+            stepIndexedMetrics.put(metric.getId(), metric.getImmutableClone());
+            positionIndexedMetrics.put(ix++, metric.getImmutableClone());
         }
     }
 


Mime
View raw message