Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8289431

(zipfs) Avoid redundant HashMap.get in ZipFileSystemProvider.removeFileSystem

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 20
    • None
    • core-libs
    • b05

      In the method jdk.nio.zipfs.ZipFileSystemProvider#removeFileSystem:

                  if (filesystems.get(zfpath) == zfs)
                      filesystems.remove(zfpath);

      Instead of separate HashMap.get/remove calls we can just use single HashMap.remove(key, value) call.
      It results in cleaner and a bit faster code.

            aturbanov Andrey Turbanov
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: