Skip to content

Commit 5b79995

Browse files
committed
remove buffer indirection
1 parent 11fe4e6 commit 5b79995

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

buffer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ type buffer struct {
2424
length int
2525
}
2626

27-
func newBuffer(rd io.Reader) *buffer {
27+
func newBuffer(rd io.Reader) buffer {
2828
var b [defaultBufSize]byte
29-
return &buffer{
29+
return buffer{
3030
buf: b[:],
3131
rd: rd,
3232
}

connection.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
)
1919

2020
type mysqlConn struct {
21-
buf *buffer
21+
buf buffer
2222
netConn net.Conn
2323
affectedRows uint64
2424
insertId uint64
@@ -124,7 +124,7 @@ func (mc *mysqlConn) Close() (err error) {
124124
}
125125

126126
mc.cfg = nil
127-
mc.buf = nil
127+
mc.buf.rd = nil
128128

129129
return
130130
}

0 commit comments

Comments
 (0)