Skip to content

Commit d78ba17

Browse files
committed
Minor code simplification for writePacket
1 parent f975c34 commit d78ba17

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packets.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (mc *mysqlConn) writePacket(data []byte) error {
102102
if err == nil && n == 4+size {
103103
mc.sequence++
104104
if size != maxPacketSize {
105-
break
105+
return nil
106106
}
107107
pktLen -= size
108108
data = data[size:]
@@ -117,8 +117,6 @@ func (mc *mysqlConn) writePacket(data []byte) error {
117117
}
118118
return driver.ErrBadConn
119119
}
120-
121-
return nil
122120
}
123121

124122
/******************************************************************************

0 commit comments

Comments
 (0)