Skip to content

Commit

Permalink
encoding/json: don't reset before returning buffer to pool
Browse files Browse the repository at this point in the history
Reset is already performed when retrieving from pool

Change-Id: Ia810dd18d3e55a1565a5ad435a00d1e46724576c
GitHub-Last-Rev: d9df74a4aeb86e5d292c9fc33568a3c9a64a967d
GitHub-Pull-Request: golang/go#34195
Reviewed-on: https://go-review.googlesource.com/c/go/+/194338
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
andig authored and mvdan committed Sep 10, 2019
1 parent 994831d commit 3c2dc14
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ func Marshal(v interface{}) ([]byte, error) {
}
buf := append([]byte(nil), e.Bytes()...)

e.Reset()
encodeStatePool.Put(e)

return buf, nil
Expand Down

0 comments on commit 3c2dc14

Please sign in to comment.