Merge pull request #4669 from frioux/simplifyBufferPool
Simplify initialization function of bytes.Buffer
This commit is contained in:
commit
d4f0f55d71
1 changed files with 1 additions and 2 deletions
|
@ -31,8 +31,7 @@ func NewBufferPool(s int) *BufferPool {
|
||||||
return &BufferPool{
|
return &BufferPool{
|
||||||
Pool: sync.Pool{
|
Pool: sync.Pool{
|
||||||
New: func() interface{} {
|
New: func() interface{} {
|
||||||
b := bytes.NewBuffer(make([]byte, s))
|
b := bytes.NewBuffer(make([]byte, 0, s))
|
||||||
b.Reset()
|
|
||||||
return b
|
return b
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue