RFR: 8311864: Add ArraysSupport.hashCode(int[] a, fromIndex, length, initialValue)
Pavel Rappo
prappo at openjdk.org
Fri Jul 28 12:59:51 UTC 2023
On Fri, 28 Jul 2023 12:37:13 GMT, Claes Redestad <redestad at openjdk.org> wrote:
> > Perhaps surprisingly, we don't need int[]; what JDK seems to use is these:
> >
> > * byte[]
> > * unsigned byte[]
> > * Object[]
>
> All `vectorizedHashCode` variants are exposed (and testable) via the public `java.util.Arrays.hashCode(byte/char/short/int[])` methods.
There seems to be misunderstanding. Here's the intent of my earlier comment: it's only those three variants above that I found to be used in JDK where a subrange or, to a lesser extent, a different initial value is desired. This is ironic since this PR is titled as "Add ArraysSupport.hashCode(**int**[] a, fromIndex, length, initialValue)". I guess it's because I filed the PR before I gathered enough stats.
One lighter-weight alternative to providing more mid-layer methods would be to rename `basicType` constants to be more self-descriptive. Thoughts?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14831#issuecomment-1655640886
More information about the core-libs-dev
mailing list