From 3d3283411cf8b16310e5972d8658d5e9c5aedcb6 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 11 Apr 2022 14:40:00 +0300 Subject: [PATCH] [#393] signature: Do not allocate a signature explicitly Helpers from `util/signature` already allocates it for us. Signed-off-by: Evgenii Stratonikov --- signature/sign.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/signature/sign.go b/signature/sign.go index e11642e1..44ec2c4c 100644 --- a/signature/sign.go +++ b/signature/sign.go @@ -194,14 +194,14 @@ func SignServiceMessage(key *ecdsa.PrivateKey, msg interface{}) error { } func signServiceMessagePart(key *ecdsa.PrivateKey, part stableMarshaler, sigWrite func(*refs.Signature)) error { - sig := new(refs.Signature) + var sig *refs.Signature // sign part if err := signature.SignDataWithHandler( key, &StableMarshalerWrapper{part}, func(s *refs.Signature) { - *sig = *s + sig = s }, ); err != nil { return err