thecoop commented on PR #11942:
URL: https://github.com/apache/lucene/pull/11942#issuecomment-1318919917

   I think a lot of the existing uses are confusion over what the `int` 
constructor parameter actually means - it is not the number of items that could 
be stored before resizing (as it is in `ArrayList`) but the hash backing array 
size (modulo pow2 rounding), that could be max 75% full before resizing.
   
   Several uses are already calculating the correct number in-line, so that 
should be pulled into a shared method anyway.
   
   I also note that this is an easy way to migrate to `HashMap.newHashMap(int)` 
method in JDK19, when lucene moves onto that version.


-- 
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: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to