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

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


On Wed, 6 Dec 2023 15:33:02 GMT, Vladimir Sitnikov <vsitnikov at openjdk.org> wrote:

>> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8321279: Fix hashCode()
>
> src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template line 710:
> 
>> 708: 
>> 709:     public int hashCode() {
>> 710:         return ArraysSupport.vectorizedHashCode(hb, position(), limit() - position(), 1, ArraysSupport.T_BYTE);
> 
> Suggestion:
> 
>         return ArraysSupport.vectorizedHashCode(hb, ix(offset()), remaining(), 1, ArraysSupport.T_BYTE);

Good point, done

> src/java.base/share/classes/java/nio/Heap-X-Buffer.java.template line 741:
> 
>> 739: 
>> 740:     public int hashCode() {
>> 741:         return ArraysSupport.vectorizedHashCode(hb, position(), limit() - position(), 1, ArraysSupport.T_CHAR);
> 
> Suggestion:
> 
>         return ArraysSupport.vectorizedHashCode(hb, ix(position()), remaining(), 1, ArraysSupport.T_CHAR);

Done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16992#discussion_r1417903477
PR Review Comment: https://git.openjdk.org/jdk/pull/16992#discussion_r1417903522


More information about the nio-dev mailing list