From ff2c4b7c35a07b0c1e90ce72aa7bfe41bb66a3cb Mon Sep 17 00:00:00 2001 From: Jia Zhan Date: Sat, 25 Apr 2020 22:26:19 +0000 Subject: [PATCH] http2: remove unused addConn `addConn` is dead code that's not used any more. `addConnLocked` is used when a new connection needs to be added to the connection pool, and the callers always manage the lock. Change-Id: I27d4a402e243a34f8ad707645738953764e05eb3 GitHub-Last-Rev: a213978a8553bee95d60d31ca00e7f784d55ecd9 GitHub-Pull-Request: golang/net#70 Reviewed-on: https://go-review.googlesource.com/c/net/+/230201 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- http2/client_conn_pool.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/http2/client_conn_pool.go b/http2/client_conn_pool.go index f4d9b5ec..95eb63c9 100644 --- a/http2/client_conn_pool.go +++ b/http2/client_conn_pool.go @@ -200,12 +200,6 @@ func (c *addConnCall) run(t *Transport, key string, tc *tls.Conn) { close(c.done) } -func (p *clientConnPool) addConn(key string, cc *ClientConn) { - p.mu.Lock() - p.addConnLocked(key, cc) - p.mu.Unlock() -} - // p.mu must be held func (p *clientConnPool) addConnLocked(key string, cc *ClientConn) { for _, v := range p.conns[key] {