KomachiSion commented on a change in pull request #3023: fix bug 2193
URL: 
https://github.com/apache/incubator-shardingsphere/pull/3023#discussion_r323566424
 
 

 ##########
 File path: 
sharding-core/sharding-core-common/src/main/java/org/apache/shardingsphere/core/strategy/route/inline/InlineShardingStrategy.java
 ##########
 @@ -58,7 +61,17 @@ public InlineShardingStrategy(final 
InlineShardingStrategyConfiguration inlineSh
         Preconditions.checkState(shardingValue instanceof ListRouteValue, 
"Inline strategy cannot support range sharding.");
         Collection<String> shardingResult = doSharding((ListRouteValue) 
shardingValue);
         Collection<String> result = new 
TreeSet<>(String.CASE_INSENSITIVE_ORDER);
-        result.addAll(shardingResult);
+        Map<String, String> availableTargetNamesMap = 
Maps.uniqueIndex(availableTargetNames, new Function<String, String>() {
+            @Override
+            public String apply(String input) {
+                return input;
+            }
+        });
+        for (String each : shardingResult) {
+            if (availableTargetNamesMap.containsKey(each)) {
 
 Review comment:
   can be instead by  `availableTargetNames.contain(each)` 

----------------------------------------------------------------
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