RFR: 8321279: Implement hashCode() in Heap-X-Buffer.java.template [v3]

Sergey Tsypanov stsypanov at openjdk.org
Wed Dec 6 19:55:01 UTC 2023


> Currently `Heap*Buffer.hashCode()` is inherited from `*Buffer` and implemented as 
> 
> public int hashCode() {
>     int h = 1;
>     int p = position();
>     for (int i = limit() - 1; i >= p; i--)
>         h = 31 * h + (int)get(i);
>     return h;
> }
> 
> This can be improved using `ArraysSupport.vectorizedHashCode()`

Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:

  8321279: Fix hashCode()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/16992/files
  - new: https://git.openjdk.org/jdk/pull/16992/files/8927a970..596d6a10

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=16992&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=16992&range=01-02

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/16992.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16992/head:pull/16992

PR: https://git.openjdk.org/jdk/pull/16992


More information about the nio-dev mailing list