Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-11-09 Thread Сергей Цыпанов
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

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-21 Thread ExE Boss
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. >

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-21 Thread ExE Boss
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

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-21 Thread Сергей Цыпанов
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: } >>

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-17 Thread liach
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

Re: RFR: 8293630: Simplify TreeMap.get() with Comparator.naturalOrder() [v4]

2022-10-17 Thread Сергей Цыпанов
> 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?