You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/02/18 15:34:18 UTC
[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #15498: Replace high frequency stream with loop
TeslaCN commented on a change in pull request #15498:
URL: https://github.com/apache/shardingsphere/pull/15498#discussion_r810108699
##########
File path: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-core/src/main/java/org/apache/shardingsphere/sharding/rule/ShardingRule.java
##########
@@ -314,7 +314,13 @@ public boolean isAllBindingTables(final ShardingSphereSchema schema, final SQLSt
}
private Optional<BindingTableRule> findBindingTableRule(final Collection<String> logicTableNames) {
- return logicTableNames.stream().map(this::findBindingTableRule).filter(Optional::isPresent).findFirst().orElse(Optional.empty());
+ for (String logicTableName : logicTableNames) {
Review comment:
Fixed.
##########
File path: shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/statement/dml/DeleteStatementContext.java
##########
@@ -56,8 +55,12 @@ public DeleteStatementContext(final DeleteStatement sqlStatement) {
}
private Collection<SimpleTableSegment> filterAliasDeleteTable(final Collection<SimpleTableSegment> tableSegments) {
- Map<String, SimpleTableSegment> aliasTableSegmentMap = tableSegments.stream().filter(each
- -> each.getAlias().isPresent()).collect(Collectors.toMap(each -> each.getAlias().get(), Function.identity(), (oldValue, currentValue) -> oldValue));
+ Map<String, SimpleTableSegment> aliasTableSegmentMap = new HashMap<>(tableSegments.size(), 1f);
+ for (SimpleTableSegment tableSegment : tableSegments) {
Review comment:
Fixed.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org