Merge pull request #4669 from frioux/simplifyBufferPool

Simplify initialization function of bytes.Buffer
This commit is contained in:
Kubernetes Prow Robot 2019-10-12 10:46:37 -07:00 committed by GitHub
commit 32d32f4491

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
},
},