RFR: 8314502: Change the comparator taking version of GrowableArray::find to be a template method [v8]
Afshin Zafari
azafari at openjdk.org
Fri Nov 17 13:22:38 UTC 2023
On Thu, 16 Nov 2023 06:46:48 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> function pointer is replaced with template Functor.
>
> src/hotspot/share/utilities/growableArray.hpp line 213:
>
>> 211:
>> 212: template<typename T, typename F>
>> 213: int find(T* token, F f) const {
>
> Should be
>
> template <typename F>
> int find(F f) const {
> for (int i = 0; i < _len; i++) {
> if (f(_data[i]) {
> return i;
> }
> }
> return -1;
> }
We need `token` to find it in the array, don't we? All the invocations pass such a function with two parameters. The change here needs all invocations to be changed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1397293350
More information about the hotspot-dev
mailing list