RFR: 8186958: Need method to create pre-sized HashMap [v10]
XenoAmess
duke at openjdk.java.net
Wed Apr 6 16:02:33 UTC 2022
On Wed, 6 Apr 2022 02:38:17 GMT, Stuart Marks <smarks at openjdk.org> wrote:
>> XenoAmess has updated the pull request incrementally with one additional commit since the last revision:
>>
>> revert changes in jdk.compile
>
> src/java.base/share/classes/java/util/HashMap.java line 2556:
>
>> 2554: */
>> 2555: static int calculateHashMapCapacity(int numMappings) {
>> 2556: return (int) Math.ceil(numMappings / 0.75);
>
> Please use `(double) DEFAULT_LOAD_FACTOR` instead of `0.75`.
@stuart-marks done.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7928
More information about the core-libs-dev
mailing list