Refactor: bufferpool new function (#407)

This commit is contained in:
Jason Lyu
2024-09-23 02:39:36 +08:00
committed by GitHub
parent 428f82694a
commit 56786517dc
+1 -3
View File
@@ -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 {