Instead of separate `.get(Key)`+`.remove(Key)` calls we can call `.remove(Key, 
Value)`.
`peerMap` is an `IdentityHashMap`. IdentityHashMap.remove compares values with 
== since Java 20 ([JDK-8178355](https://bugs.openjdk.org/browse/JDK-8178355))

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

Commit messages:
 - [PATCH] Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer

Changes: https://git.openjdk.org/jdk/pull/24858/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24858&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8357686
  Stats: 3 lines in 1 file changed: 0 ins; 1 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/24858.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24858/head:pull/24858

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

Reply via email to