yu199195 commented on a change in pull request #4863: shadingRule lambda modify.
URL:
https://github.com/apache/incubator-shardingsphere/pull/4863#discussion_r395533657
##########
File path:
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/rule/ShardingRule.java
##########
@@ -85,36 +85,29 @@ public ShardingRule(final ShardingRuleConfiguration
shardingRuleConfig, final Co
}
private Collection<TableRule> createTableRules(final
ShardingRuleConfiguration shardingRuleConfig) {
- Collection<TableRuleConfiguration> tableRuleConfigurations =
shardingRuleConfig.getTableRuleConfigs();
- Collection<TableRule> result = new
ArrayList<>(tableRuleConfigurations.size());
- for (TableRuleConfiguration each : tableRuleConfigurations) {
- result.add(new TableRule(each, shardingDataSourceNames,
getDefaultGenerateKeyColumn(shardingRuleConfig)));
- }
- return result;
+ return shardingRuleConfig.getTableRuleConfigs().stream()
+ .map(each -> new TableRule(each, shardingDataSourceNames,
getDefaultGenerateKeyColumn(shardingRuleConfig)))
Review comment:
Ok,i will fix it
----------------------------------------------------------------
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