8288468: Avoid redundant HashMap.get call in NegotiateAuthentication.firstToken

Reviewed-by: dfuchs, jpai
This commit is contained in:
Andrey Turbanov 2022-06-16 16:03:05 +00:00
parent 8fc8fdca96
commit ce5024f66f

View File

@ -216,12 +216,9 @@ class NegotiateAuthentication extends AuthenticationInfo {
*/
private byte[] firstToken() throws IOException {
negotiator = null;
HashMap <String, Negotiator> cachedMap = getCache();
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
}
negotiator = cachedMap.remove(getHost()); // so that it is only used once
}
if (negotiator == null) {
negotiator = Negotiator.getNegotiator(hci);