Avoid redundant HashMap.get call in NegotiateAuthentication.firstToken

XMLWordPrintable

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

       HashMap <String, Negotiator> cachedMap = getCache();
       if (cachedMap != null) {
           negotiator = cachedMap.get(getHost());
           if (negotiator != null) {
               cachedMap.remove(getHost()); // so that it is only used once
           }
       }

      Instead of separate HashMap.get+remove call, we can use single HashMap.remove call and use its return value.
      It makes code a bit cleaner and faster.

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

              Created:
              Updated:
              Resolved: