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 2021/04/07 12:06:55 UTC

[GitHub] [shardingsphere] terrymanu commented on a change in pull request #9967: Issue#9948 refactor TablesContext

terrymanu commented on a change in pull request #9967:
URL: https://github.com/apache/shardingsphere/pull/9967#discussion_r608592261



##########
File path: shardingsphere-infra/shardingsphere-infra-binder/src/main/java/org/apache/shardingsphere/infra/binder/segment/table/TablesContext.java
##########
@@ -46,14 +46,9 @@ public TablesContext(final SimpleTableSegment tableSegment) {
     }
     
     public TablesContext(final Collection<SimpleTableSegment> tableSegments) {
-        Map<String, SimpleTableSegment> tableMaps = new HashMap<>(1, 1);
-        Collection<SimpleTableSegment> actualTables = new LinkedList<>();
-        for (SimpleTableSegment each : tableSegments) {
-            if (!tableMaps.containsKey(each.getTableName().getIdentifier().getValue())) {
-                tableMaps.put(each.getTableName().getIdentifier().getValue(), each);
-                actualTables.add(each);
-            }
-        }
+        Collection<SimpleTableSegment> actualTables = new LinkedList<>(tableSegments);
+        Set<String> seen = new HashSet<>();

Review comment:
       What is `seen` mean?




-- 
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:
users@infra.apache.org