On Mon, 17 Oct 2022 10:19:26 GMT, Сергей Цыпанов wrote:
>> We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance
>> is constructed without comparator. This allows to squash two branches in
>> `TreeMap.get()` into one.
>>
>> P.S. I think the comment of
On Fri, 21 Oct 2022 12:11:28 GMT, ExE Boss wrote:
>> From one point this is obviously a change in behaviour, from another the
>> spec of `Spliterator.getComparator()` says nothing about serializability of
>> returned comparator and the actual value is hardly ever going to be
>> serialized.
>
On Fri, 21 Oct 2022 11:56:57 GMT, Сергей Цыпанов wrote:
>> src/java.base/share/classes/java/util/TreeMap.java line 3329:
>>
>>> 3327: }
>>> 3328: else {
>>> 3329: return (Comparator> & Serializable)
>>> (e1, e2) -> {
>>
>> I think this cast hints
On Mon, 17 Oct 2022 19:42:14 GMT, liach wrote:
>> Сергей Цыпанов has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> 8293630: Inline natural()
>
> src/java.base/share/classes/java/util/TreeMap.java line 3329:
>
>> 3327: }
>>
On Mon, 17 Oct 2022 10:19:26 GMT, Сергей Цыпанов wrote:
>> We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance
>> is constructed without comparator. This allows to squash two branches in
>> `TreeMap.get()` into one.
>>
>> P.S. I think the comment of
> We can use `Comparator.naturalOrder()` for cases when a `TreeMap` instance is
> constructed without comparator. This allows to squash two branches in
> `TreeMap.get()` into one.
>
> P.S. I think the comment of `TreeMap.getEntryUsingComparator()` is outdated.
> Should we also change it?