diff --git a/lib/conn/snappy.go b/lib/conn/snappy.go index 3f22aa0..2ea1034 100644 --- a/lib/conn/snappy.go +++ b/lib/conn/snappy.go @@ -3,7 +3,6 @@ package conn import ( "io" - "github.com/cnlh/nps/lib/common" "github.com/golang/snappy" ) @@ -32,13 +31,7 @@ func (s *SnappyConn) Write(b []byte) (n int, err error) { //snappy压缩读 func (s *SnappyConn) Read(b []byte) (n int, err error) { - buf := common.BufPool.Get().([]byte) - defer common.BufPool.Put(buf) - if n, err = s.r.Read(buf); err != nil { - return - } - copy(b, buf[:n]) - return + return s.r.Read(b) } func (s *SnappyConn) Close() error {