RFR: 8287696: Avoid redundant Hashtable.containsKey call in JarVerifier.doneWithMeta
Andrey Turbanov
aturbanov at openjdk.java.net
Wed Jun 1 20:47:59 UTC 2022
Hashtable doesn't allow `null` values. So, instead of pair `containsKey`/`remove` calls, we can directly call `remove` and then compare result with `null`.
https://github.com/openjdk/jdk/blob/2c461acfebd28fe5ef62805cbb004f91a3b18f08/src/java.base/share/classes/java/util/jar/JarVerifier.java#L433-L436
-------------
Commit messages:
- [PATCH] Avoid redundant Hashtable.containsKey call in JarVerifier
Changes: https://git.openjdk.java.net/jdk/pull/8935/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8935&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8287696
Stats: 7 lines in 1 file changed: 0 ins; 5 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/8935.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8935/head:pull/8935
PR: https://git.openjdk.java.net/jdk/pull/8935
More information about the core-libs-dev
mailing list