RFR: 8287148: Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes.getExtendedKeyCodeForChar

Andrey Turbanov aturbanov at openjdk.java.net
Mon May 23 09:03:40 UTC 2022


`sun.awt.ExtendedKeyCodes#regularKeyCodesMap` contains only non-null values. It means we can replace containsKey+get with get+null check.
It's clearer and a bit faster.

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

Commit messages:
 - [PATCH] Avoid redundant HashMap.containsKey calls in ExtendedKeyCodes

Changes: https://git.openjdk.java.net/jdk/pull/8489/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8489&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287148
  Stats: 18 lines in 1 file changed: 3 ins; 5 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8489.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8489/head:pull/8489

PR: https://git.openjdk.java.net/jdk/pull/8489



More information about the client-libs-dev mailing list