Explorar o código

allocate less buffer for writing to []byte

Tao Wen %!s(int64=8) %!d(string=hai) anos
pai
achega
a7a7c7879a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      feature_adapter.go

+ 1 - 1
feature_adapter.go

@@ -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 {