From 20d6132f313f1fed011d18325cf6f2265f823ceb Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Thu, 2 Nov 2023 17:34:33 +0300 Subject: [PATCH] [#531] signSvc: Add SetMarshaledData method call To reduce memory allocations add `SetMarshaledData` method call to return already marshalled data in next `StableMarshal` calls. Signed-off-by: Dmitrii Stepanov --- pkg/services/object/sign.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/services/object/sign.go b/pkg/services/object/sign.go index faad26489..2f4f9cb9a 100644 --- a/pkg/services/object/sign.go +++ b/pkg/services/object/sign.go @@ -122,6 +122,7 @@ func (s *SignService) Head(ctx context.Context, req *object.HeadRequest) (*objec } func (s *SignService) PutSingle(ctx context.Context, req *object.PutSingleRequest) (*object.PutSingleResponse, error) { + req.GetBody().SetMarshalData(nil) if err := s.sigSvc.VerifyRequest(req); err != nil { resp := new(object.PutSingleResponse) return resp, s.sigSvc.SignResponse(resp, err)