Skip to content

Commit

Permalink
Merge pull request #4669 from frioux/simplifyBufferPool
Browse files Browse the repository at this point in the history
Simplify initialization function of bytes.Buffer
  • Loading branch information
k8s-ci-robot authored Oct 12, 2019
2 parents 8fd1704 + ea8f7ea commit d4f0f55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions internal/ingress/controller/template/buffer_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
},
Expand Down

0 comments on commit d4f0f55

Please sign in to comment.