RFR: 8331193: Return references when possible in GrowableArray [v7]

Johan Sjölen jsjolen at openjdk.org
Thu May 23 08:24:03 UTC 2024


On Thu, 23 May 2024 06:21:48 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> 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.

It wasn't my intention, I just fumbled the semantics when writing the tests, thanks for the catch :-).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18975#discussion_r1611232880


More information about the hotspot-dev mailing list