1
0
mirror of https://github.com/json-iterator/go.git synced 2025-03-23 21:09:11 +02:00

allocate less buffer for writing to []byte

This commit is contained in:
Tao Wen 2017-05-26 07:52:54 +08:00
parent f20f74519d
commit a7a7c7879a

View File

@ -83,7 +83,7 @@ func UnmarshalAnyFromString(str string) (Any, error) {
func Marshal(v interface{}) ([]byte, error) {
buf := &bytes.Buffer{}
stream := NewStream(buf, 4096)
stream := NewStream(buf, 512)
stream.WriteVal(v)
stream.Flush()
if stream.Error != nil {