mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
Refactor: bufferpool new function (#407)
This commit is contained in:
@@ -9,9 +9,7 @@ import (
|
||||
const _size = 1024 // by default, create 1 KiB buffers
|
||||
|
||||
var _pool = pool.New(func() *bytes.Buffer {
|
||||
buf := &bytes.Buffer{}
|
||||
buf.Grow(_size)
|
||||
return buf
|
||||
return bytes.NewBuffer(make([]byte, 0, _size))
|
||||
})
|
||||
|
||||
func Get() *bytes.Buffer {
|
||||
|
||||
Reference in New Issue
Block a user