mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-21 01:26:28 +00:00
remove reuse buf todo (#117033)
* reuse buf Signed-off-by: mouuii <49775493+mouuii@users.noreply.github.com> * remove the todo Signed-off-by: mouuii <49775493+mouuii@users.noreply.github.com> --------- Signed-off-by: mouuii <49775493+mouuii@users.noreply.github.com>
This commit is contained in:
parent
8722ab2c84
commit
9a46856307
@ -45,7 +45,6 @@ func NewCodec(e Encoder, d Decoder) Codec {
|
|||||||
|
|
||||||
// Encode is a convenience wrapper for encoding to a []byte from an Encoder
|
// Encode is a convenience wrapper for encoding to a []byte from an Encoder
|
||||||
func Encode(e Encoder, obj Object) ([]byte, error) {
|
func Encode(e Encoder, obj Object) ([]byte, error) {
|
||||||
// TODO: reuse buffer
|
|
||||||
buf := &bytes.Buffer{}
|
buf := &bytes.Buffer{}
|
||||||
if err := e.Encode(obj, buf); err != nil {
|
if err := e.Encode(obj, buf); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user