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 <bradfitz@tailscale.com>
Change-Id: If7f350b61003ea08f16a531b7b4e8ae483617939
pull/11262/head
Brad Fitzpatrick 9 months ago committed by Brad Fitzpatrick
parent 8cc5c51888
commit 9a8c2f47f2

@ -284,11 +284,10 @@ func (k NodePublic) WriteRawWithoutAllocating(bw *bufio.Writer) error {
// Raw32 returns k encoded as 32 raw bytes. // Raw32 returns k encoded as 32 raw bytes.
// //
// Deprecated: only needed for a single legacy use in the control // 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 { func (k NodePublic) Raw32() [32]byte {
var ret [32]byte return k.k
copy(ret[:], k.k[:])
return ret
} }
// Less reports whether k orders before other, using an undocumented // Less reports whether k orders before other, using an undocumented

Loading…
Cancel
Save