Skip to content

Commit

Permalink
remove buffer indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
julienschmidt committed Jun 3, 2014
1 parent 11fe4e6 commit 5b79995
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type buffer struct {
length int
}

func newBuffer(rd io.Reader) *buffer {
func newBuffer(rd io.Reader) buffer {
var b [defaultBufSize]byte
return &buffer{
return buffer{
buf: b[:],
rd: rd,
}
Expand Down
4 changes: 2 additions & 2 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

type mysqlConn struct {
buf *buffer
buf buffer
netConn net.Conn
affectedRows uint64
insertId uint64
Expand Down Expand Up @@ -124,7 +124,7 @@ func (mc *mysqlConn) Close() (err error) {
}

mc.cfg = nil
mc.buf = nil
mc.buf.rd = nil

return
}
Expand Down

0 comments on commit 5b79995

Please sign in to comment.