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

Avoid redundant HashMap.containsKey calls in ZoneName

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P5 P5
    • 19
    • None
    • core-libs
    • None
    • b22

      Map.containsKey call is sometimes unnecessary, when it's known that Map doesn't contain null values.
      Instead we can just use Map.get and compare result with null.
      I found one of such place, where Map.containsKey calls could be eliminated - java.time.format.ZoneName.
      it gives a bit of performance for 'toZid' method.

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

              Created:
              Updated:
              Resolved: