Skip to content


8288468: Avoid redundant HashMap.get call in NegotiateAuthentication.…
Browse files Browse the repository at this point in the history

Reviewed-by: dfuchs, jpai
  • Loading branch information
Andrey Turbanov committed Jun 16, 2022
1 parent 8fc8fdc commit ce5024f
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,9 @@ public boolean setHeaders(HttpURLConnection conn, HeaderParser p, String raw) {
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);
Expand Down

1 comment on commit ce5024f

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.