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

Sergey Tsypanov stsypanov at openjdk.org
Thu Dec 22 09:37:51 UTC 2022


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

Sergey Tsypanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:

 - Merge branch 'master' into tree-map-simpl
 - 8293630: Inline natural()
 - Update src/java.base/share/classes/java/util/TreeMap.java
   
   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
 - Update src/java.base/share/classes/java/util/TreeMap.java
   
   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
 - Merge remote-tracking branch 'origin/tree-map-simpl' into tree-map-simpl
 - Simplify TreeMap.get() with Comparator.naturalOrder()
 - Merge branch 'master' into tree-map-simpl
 - Simplify TreeMap.get() with Comparator.naturalOrder()

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/9901/files
  - new: https://git.openjdk.org/jdk/pull/9901/files/ae6e2320..ca1d40b6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9901&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9901&range=03-04

  Stats: 529520 lines in 6935 files changed: 265880 ins; 185707 del; 77933 mod
  Patch: https://git.openjdk.org/jdk/pull/9901.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9901/head:pull/9901

PR: https://git.openjdk.org/jdk/pull/9901


More information about the core-libs-dev mailing list