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:
parent
f20f74519d
commit
a7a7c7879a
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user