RFR: 8331193: Return references when possible in GrowableArray [v7]
Emanuel Peter
epeter at openjdk.org
Thu May 23 06:24:07 UTC 2024
On Thu, 23 May 2024 06:20:30 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Johan Sjölen has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Add test
>
> test/hotspot/gtest/utilities/test_growableArray.cpp line 672:
>
>> 670: x = 2;
>> 671: EXPECT_EQ(2, arr.at(9));
>> 672: x = arr.top();
>
> This is not using reference, right? I thought you can only use reference assignment when you declare the `x` variable. This here is using value, I think.
Maybe that was your intention. But then you should have another test where you use `top` with reference.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18975#discussion_r1611064827
More information about the hotspot-dev
mailing list