Simplify initialization function of bytes.Buffer

This commit is contained in:
Arthur Axel 'fREW' Schmidt 2019-10-12 08:36:54 -07:00
parent 2c6fbdca30
commit ea8f7ea8b7

View file

@ -31,8 +31,7 @@ func NewBufferPool(s int) *BufferPool {
return &BufferPool{
Pool: sync.Pool{
New: func() interface{} {
b := bytes.NewBuffer(make([]byte, s))
b.Reset()
b := bytes.NewBuffer(make([]byte, 0, s))
return b
},
},