RFR: 8305696: (zipfs) Avoid redundant LinkedHashMap.containsKey call ZipFileSystem.makeParentDirs
Jaikiran Pai
jpai at openjdk.org
Fri Apr 7 09:18:45 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`
Looks ok to me.
-------------
Marked as reviewed by jpai (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/13304#pullrequestreview-1376013170
More information about the nio-dev
mailing list