On Thu, 14 Apr 2022 03:38:52 GMT, Joe Wang <jo...@openjdk.org> wrote:

>>> I suspect the `size*2+1` was a failed attempt at allocating a HashMap of 
>>> the correct capacity for `size` mappings.
>> 
>> I looked the codes and don't think so..
>> If I'm wrong, I'm glad to fix.
>
> Stuart's right, I looked at the code, it's as you said a failed attempt, 
> "size" would be good. So HashMap.newHashMap(size) would actually be a small 
> improvement.
> 
> It's an interesting impl the way it used HashMap, but it's 20 year code.

@JoeWang-Java @stuart-marks got it. done.

-------------

PR: https://git.openjdk.java.net/jdk/pull/7928

Reply via email to