8288330: Avoid redundant ConcurrentHashMap.get call in Http2ClientImpl.deleteConnection

Reviewed-by: jpai, dfuchs
This commit is contained in:
Andrey Turbanov 2022-06-15 18:12:29 +00:00
parent cb5ef3da19
commit 3475e12fa6

View File

@ -188,9 +188,7 @@ class Http2ClientImpl {
if (debug.on())
debug.log("removing from the connection pool: %s", c);
synchronized (this) {
Http2Connection c1 = connections.get(c.key());
if (c1 != null && c1.equals(c)) {
connections.remove(c.key());
if (connections.remove(c.key(), c)) {
if (debug.on())
debug.log("removed from the connection pool: %s", c);
}