From 9a8c2f47f25217239d9ba40d6259aa5d37ac6a06 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sun, 25 Feb 2024 06:39:01 -0800 Subject: [PATCH] types/key: remove copy returning array by value It's unnecessary. Returning an array value is already a copy. Updates #cleanup Signed-off-by: Brad Fitzpatrick Change-Id: If7f350b61003ea08f16a531b7b4e8ae483617939 --- types/key/node.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/types/key/node.go b/types/key/node.go index 6142bf68a..11ee1fa3c 100644 --- a/types/key/node.go +++ b/types/key/node.go @@ -284,11 +284,10 @@ func (k NodePublic) WriteRawWithoutAllocating(bw *bufio.Writer) error { // Raw32 returns k encoded as 32 raw bytes. // // Deprecated: only needed for a single legacy use in the control -// server, don't add more uses. +// server and a few places in the wireguard-go API; don't add +// more uses. func (k NodePublic) Raw32() [32]byte { - var ret [32]byte - copy(ret[:], k.k[:]) - return ret + return k.k } // Less reports whether k orders before other, using an undocumented