Skip to content

Commit 745998a

Browse files
committed
Remove the buffer copying, no longer necessary
1 parent 7e9e660 commit 745998a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

packets.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,7 @@ func (mc *mysqlConn) readPacket() ([]byte, error) {
6161
return nil, driver.ErrBadConn
6262
}
6363

64-
// Make a copy since data becomes invalid with the next read
65-
buf := make([]byte, len(data))
66-
copy(buf, data)
67-
68-
payload = append(payload, buf...)
64+
payload = append(payload, data...)
6965

7066
if pktLen < maxPacketSize {
7167
return payload, nil

0 commit comments

Comments
 (0)