Improve: avoid bufconn twice (#1650)
This commit is contained in:
1 parent
70c8605cca
commit
9aeb4c8cfe
1 file changed
+3
@@ -11,6 +11,9 @@ type BufferedConn struct {
|
||||
}
|
||||
|
||||
func NewBufferedConn(c net.Conn) *BufferedConn {
|
||||
if bc, ok := c.(*BufferedConn); ok {
|
||||
return bc
|
||||
}
|
||||
return &BufferedConn{bufio.NewReader(c), c}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user