On Fri, 17 Nov 2023 13:19:40 GMT, Afshin Zafari <azaf...@openjdk.org> wrote:

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

No, it can be embedded into the function object.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15418#discussion_r1397336104

Reply via email to