On Tue, 1 Jul 2025 15:41:45 GMT, Alan Bateman <al...@openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - 8360884: Better scoped values
>>  - 8360884: Better scoped values
>
> src/java.base/share/classes/java/lang/ScopedValue.java line 534:
> 
>> 532: 
>> 533:     private ScopedValue() {
>> 534:         this.hash = hashGenerator != null ? hashGenerator.getAsInt() : 
>> generateKey();
> 
> The updated version looks much better. It might just a bit clearer to read 
> hashGenerator once here (it doesn't matter of course but stable fields tend 
> to attract a lot of questions).

Something like this?
Suggestion:

        final IntSupplier hashGen = hashGenerator;
        this.hash = hashGen != null ? hashGen.getAsInt() : generateKey();

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26019#discussion_r2179229055

Reply via email to