RFR: 8186958: Need method to create pre-sized HashMap [v18]
XenoAmess
duke at openjdk.java.net
Thu Apr 14 01:18:10 UTC 2022
On Wed, 13 Apr 2022 22:57:33 GMT, Stuart Marks <smarks at openjdk.org> wrote:
> Not `_size+2` ?
I don't have a idea here why he original use the + 2.
Is there any guy more familiar with this code tell me why?
Thanks!
> 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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7928
More information about the security-dev
mailing list