Skip to content

Commit 3475e12

Browse files
author
Andrey Turbanov
committed
8288330: Avoid redundant ConcurrentHashMap.get call in Http2ClientImpl.deleteConnection
Reviewed-by: jpai, dfuchs
1 parent cb5ef3d commit 3475e12

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/java.net.http/share/classes/jdk/internal/net/http/Http2ClientImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ void deleteConnection(Http2Connection c) {
188188
if (debug.on())
189189
debug.log("removing from the connection pool: %s", c);
190190
synchronized (this) {
191-
Http2Connection c1 = connections.get(c.key());
192-
if (c1 != null && c1.equals(c)) {
193-
connections.remove(c.key());
191+
if (connections.remove(c.key(), c)) {
194192
if (debug.on())
195193
debug.log("removed from the connection pool: %s", c);
196194
}

0 commit comments

Comments
 (0)