RFR: 8305696: (zipfs) Avoid redundant LinkedHashMap.containsKey call ZipFileSystem.makeParentDirs

Lance Andersen lancea at openjdk.org
Fri Apr 7 10:20:43 UTC 2023


On Mon, 3 Apr 2023 17:16:26 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:

> `LinkedHashMap<IndexNode, IndexNode>` `ZipFileSystem.inodes` contains only non-null values. It means instead of separate `containsKey`+`get` calls, we can use single `LinkedHashMap.get` call and then compare result with `null`.
> Result code is a bit simpler and faster.
> 
> Testing: Linux x64 `java/nio`, `jdk/nio`

Marked as reviewed by lancea (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/13304#pullrequestreview-1376064521


More information about the nio-dev mailing list