Browse Source

Remove unnecessary hash map copy in o.e.b.Security

This commit removes an unnecessary copying of the tribe node group
settings in o.e.b.Security.
Jason Tedor 9 years ago
parent
commit
9fb54f4ef8
1 changed files with 1 additions and 2 deletions
  1. 1 2
      core/src/main/java/org/elasticsearch/bootstrap/Security.java

+ 1 - 2
core/src/main/java/org/elasticsearch/bootstrap/Security.java

@@ -294,8 +294,7 @@ final class Security {
             }
             }
         }
         }
 
 
-        final Map<String, Settings> tribeNodesSettings = new HashMap<>(settings.getGroups("tribe", true));
-        for (final Settings tribeNodeSettings : tribeNodesSettings.values()) {
+        for (final Settings tribeNodeSettings : settings.getGroups("tribe", true).values()) {
             // tribe nodes have HTTP disabled by default, so we check if HTTP is enabled before granting
             // tribe nodes have HTTP disabled by default, so we check if HTTP is enabled before granting
             if (NetworkModule.HTTP_ENABLED.exists(tribeNodeSettings) && NetworkModule.HTTP_ENABLED.get(tribeNodeSettings)) {
             if (NetworkModule.HTTP_ENABLED.exists(tribeNodeSettings) && NetworkModule.HTTP_ENABLED.get(tribeNodeSettings)) {
                 addSocketPermissionForHttp(policy, tribeNodeSettings);
                 addSocketPermissionForHttp(policy, tribeNodeSettings);