You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/02/24 07:12:49 UTC

[42/53] [abbrv] lucene-solr git commit: SOLR-8377 removed an unnecessary for loop

SOLR-8377 removed an unnecessary for loop


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/eb1f8e24
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/eb1f8e24
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/eb1f8e24

Branch: refs/heads/apiv2
Commit: eb1f8e2409c56a915bf8b88c19b7f6f66823a7f9
Parents: 261681c
Author: Noble Paul <no...@apache.org>
Authored: Tue Feb 23 06:12:33 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Feb 23 06:12:33 2016 +0530

----------------------------------------------------------------------
 .../apache/solr/cloud/rule/ReplicaAssigner.java | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/eb1f8e24/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java b/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
index f3f5b41..51d9848 100644
--- a/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
+++ b/solr/core/src/java/org/apache/solr/cloud/rule/ReplicaAssigner.java
@@ -189,20 +189,18 @@ public class ReplicaAssigner {
 
     for (; shardPermutations.hasNext(); ) {
       int[] p = shardPermutations.next();
-      for (int i = 0; i < p.length; i++) {
-        List<Position> positions = new ArrayList<>();
-        for (int pos : p) {
-          for (int j = 0; j < shardVsReplicaCount.get(shardNames.get(pos)); j++) {
-            positions.add(new Position(shardNames.get(pos), j));
-          }
-        }
-        Collections.sort(positions);
-        for (Iterator<int[]> it = permutations(rules.size()); it.hasNext(); ) {
-          int[] permutation = it.next();
-          Map<Position, String> result = tryAPermutationOfRules(permutation, positions, fuzzyPhase);
-          if (result != null) return result;
+      List<Position> positions = new ArrayList<>();
+      for (int pos : p) {
+        for (int j = 0; j < shardVsReplicaCount.get(shardNames.get(pos)); j++) {
+          positions.add(new Position(shardNames.get(pos), j));
         }
       }
+      Collections.sort(positions);
+      for (Iterator<int[]> it = permutations(rules.size()); it.hasNext(); ) {
+        int[] permutation = it.next();
+        Map<Position, String> result = tryAPermutationOfRules(permutation, positions, fuzzyPhase);
+        if (result != null) return result;
+      }
     }
 
     return null;