bruno-roustant commented on code in PR #1466:
URL: https://github.com/apache/solr/pull/1466#discussion_r1144355359


##########
solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java:
##########
@@ -77,7 +77,7 @@ protected boolean lessThan(Long a, Long b) {
             }
           };
 
-      Map<String, Long> childToModificationZxid = 
Maps.newHashMapWithExpectedSize(children.size());
+      Map<String, Long> childToModificationZxid = new 
HashMap<>(children.size());

Review Comment:
   We can use org.apache.lucene.util.CollectionUtil.newHashMap(int size) to 
avoid resizing and rehashing during the construction.
   And later with JDK 19, we will be able to use HashMap.newHashMap(int 
numMappings).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to