RFR: 8357686: Remove unnecessary Map.get from AWTAutoShutdown.unregisterPeer

Sergey Bylokhov serb at openjdk.org
Sat May 24 16:36:04 UTC 2025


On Thu, 24 Apr 2025 20:18:01 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

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

looks fine

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

PR Comment: https://git.openjdk.org/jdk/pull/24858#issuecomment-2882061238


More information about the client-libs-dev mailing list