kimmking commented on a change in pull request #4955:  lambda code modify.
URL: 
https://github.com/apache/incubator-shardingsphere/pull/4955#discussion_r398398738
 
 

 ##########
 File path: 
sharding-proxy/sharding-proxy-common/src/main/java/org/apache/shardingsphere/shardingproxy/config/ShardingConfigurationLoader.java
 ##########
 @@ -64,10 +64,7 @@ public ShardingConfiguration load(final String path) throws 
IOException {
             });
         }
         Preconditions.checkState(!ruleConfigurations.isEmpty() || null != 
serverConfig.getOrchestration(), "Can not find any sharding rule configuration 
file in path `%s`.", configPath.getPath());
-        Map<String, YamlProxyRuleConfiguration> ruleConfigurationMap = new 
HashMap<>(ruleConfigurations.size(), 1);
-        for (YamlProxyRuleConfiguration each : ruleConfigurations) {
-            ruleConfigurationMap.put(each.getSchemaName(), each);
-        }
+        Map<String, YamlProxyRuleConfiguration> ruleConfigurationMap = 
ruleConfigurations.stream().collect(Collectors.toMap(YamlProxyRuleConfiguration::getSchemaName,
 each -> each));
         return new ShardingConfiguration(serverConfig, ruleConfigurationMap);
 
 Review comment:
   can combine one line
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to