]> Cypherpunks.ru repositories - gostls13.git/commit
database/sql: remove a distracting alloc, use atomic.Bool
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 10 Mar 2023 17:38:49 +0000 (09:38 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 14 Mar 2023 20:34:27 +0000 (20:34 +0000)
commit08c32998297e66486416d4021630510eafdcd81e
tree0d1631a348053d49763c4e515a2bb392f82b919e
parent46bc9a6e1e94d0c7929a4835a3d163b721085329
database/sql: remove a distracting alloc, use atomic.Bool

This removes an allocation in Conn.grabConn that, while not super
important, was distracting me when optimizing code elsewhere.

While here, convert an atomic that was forgotten when this package was
earlier updated to use the new Go 1.19 typed atomics.

Change-Id: I4666256b4c0512e2162bd485c389130699f9d5ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/475415
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
src/database/sql/sql.go
src/database/sql/sql_test.go