mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2025-01-10 03:09:04 +08:00
Improve: avoid bufconn twice (#1650)
This commit is contained in:
commit
d404e76c24
@ -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}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user