1
0
mirror of https://github.com/golang/go synced 2024-11-18 22:55:23 -07:00

database/sql: Remove unnecessary call to maybeOpenNewConnections

numCanOpen will never be larger than 0 in maybeOpenNewConnections() when this
code path is taken, so no new connections can ever be opened.

Change-Id: Id1302e8d9afb3a67be61b5e738fe07ef81d20fe0
Reviewed-on: https://go-review.googlesource.com/1550
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Marko Tiikkaja 2014-12-14 03:57:14 +01:00 committed by Brad Fitzpatrick
parent 04cf881fbe
commit 9371babdd8

View File

@ -644,7 +644,6 @@ func (db *DB) conn() (*driverConn, error) {
// connectionOpener doesn't block while waiting for the req to be read.
req := make(chan connRequest, 1)
db.connRequests = append(db.connRequests, req)
db.maybeOpenNewConnections()
db.mu.Unlock()
ret := <-req
return ret.conn, ret.err