Avoid redundant HashMap.containsKey call in EnvHelp.mapToHashtable

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P5
    • 20
    • Affects Version/s: None
    • Component/s: core-svc

      No need to separately perform HashMap.containsKey before HashMap.remove call. If key is present - it will be removed anyway. If it's not present, nothing will be deleted.

           HashMap<K, V> m = new HashMap<K, V>(map);
           if (m.containsKey(null)) m.remove(null);

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

              Created:
              Updated:
              Resolved: