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

Andrey Turbanov aturbanov at openjdk.java.net
Wed Jun 15 07:26:01 UTC 2022


Instead of separate `HashMap.get`+`remove` call, we can use single `HashMap.remove` call and use its return value.
https://github.com/openjdk/jdk/blob/53a0acee06eb32fba700967c9a34d37ea42f7a99/src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java#L219-L225
It makes code a bit cleaner and faster.

-------------

Commit messages:
 - [PATCH] Avoid redundant HashMap.get call in NegotiateAuthentication.firstToken

Changes: https://git.openjdk.org/jdk/pull/9145/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9145&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288468
  Stats: 5 lines in 1 file changed: 0 ins; 3 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/9145.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9145/head:pull/9145

PR: https://git.openjdk.org/jdk/pull/9145


More information about the net-dev mailing list