On Fri, 18 Apr 2025 14:30:51 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Address comments on original vs underlying
>
> src/java.base/share/classes/java/util/ImmutableCollections.java line 1592:
> 
>> 1590:                     final K k = inner.getKey();
>> 1591:                     return new NullableKeyValueHolder<>(k, 
>> inner.getValue().orElseSet(new Supplier<V>() {
>> 1592:                         @Override public V get() { return 
>> mapper.apply(k); }}));
> 
> I suppose you could potentially make this more lazy by returning an `Entry` 
> implementation that only evaluates the mapper when calling `Entry::getValue`.

Yepp. Interesting idea.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2053909004

Reply via email to