RFR: 8186958: Need method to create pre-sized HashMap [v5]

XenoAmess duke at openjdk.java.net
Thu Mar 24 17:43:32 UTC 2022


On Thu, 24 Mar 2022 17:09:21 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

> I'm not too picky about how it is documented, as long as it is clear how the number 1610612733 is computed and why its the correct number. And I think that's working backward from Integer.MAX_VALUE. As for its precision, its almost irrelevant since the actual size must be a power of two; and precision is only important near the boundary of a power of two. A simple and obvious explanation is better than one that is overly precise (when it matters).

@RogerRiggs
Got it. I''ve changed it and added some docs about the calculation, please have a look again. thanks.

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

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


More information about the core-libs-dev mailing list