RFR: 8186958: Need method to create pre-sized HashMap [v12]
liach
duke at openjdk.java.net
Sat Apr 9 04:36:41 UTC 2022
On Wed, 6 Apr 2022 16:02:31 GMT, XenoAmess <duke at openjdk.java.net> wrote:
>> 8186958: Need method to create pre-sized HashMap
>
> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
>
> use (double) DEFAULT_LOAD_FACTOR instead of 0.75
Quick question: If the maps are intended to be fixed-size, can't the users just call `new HashMap<>(size, 1)`, increasing the growth factor to prevent growth?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7928
More information about the core-libs-dev
mailing list