update codec to allow reuse buffers
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
9e8cb4ad41
commit
0715891c86
@ -142,7 +142,7 @@ func (c *jsonpbCodecV2) Marshal(d []byte, v interface{}, opts ...codec.Option) (
|
|||||||
marshalOptions = f
|
marshalOptions = f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return marshalOptions.MarshalAppend(d, m)
|
return marshalOptions.MarshalAppend(d[:0], m)
|
||||||
default:
|
default:
|
||||||
return nil, codec.ErrInvalidMessage
|
return nil, codec.ErrInvalidMessage
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user