From 67cb0ea8fb87c77bb88f0dbfa6e194ee2b562a91 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 3 Apr 2025 18:59:22 -0300 Subject: [PATCH] this was missing? --- event_easyjson.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/event_easyjson.go b/event_easyjson.go index e6b363a..b5cb872 100644 --- a/event_easyjson.go +++ b/event_easyjson.go @@ -25,7 +25,6 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event) return } in.Delim('{') - var reusableBuffer [64]byte for !in.IsDelim('}') { key := in.UnsafeFieldName(true) in.WantColon() @@ -36,11 +35,9 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event) } switch key { case "id": - hex.Decode(reusableBuffer[:], []byte(in.String())) - copy(out.ID[:], reusableBuffer[0:32]) + hex.Decode(out.ID[:], []byte(in.String())) case "pubkey": - hex.Decode(reusableBuffer[:], []byte(in.String())) - copy(out.PubKey[:], reusableBuffer[0:32]) + hex.Decode(out.PubKey[:], []byte(in.String())) case "created_at": out.CreatedAt = Timestamp(in.Int64()) case "kind": @@ -88,8 +85,7 @@ func easyjsonF642ad3eDecodeGithubComNbdWtfGoNostr(in *jlexer.Lexer, out *Event) case "content": out.Content = in.String() case "sig": - hex.Decode(reusableBuffer[:], []byte(in.String())) - copy(out.Sig[:], reusableBuffer[0:64]) + hex.Decode(out.Sig[:], []byte(in.String())) } in.WantComma() }