From ae62b45b82888537d27a55d295fd266b30f496e0 Mon Sep 17 00:00:00 2001 From: Timur Demin Date: Sun, 1 Aug 2021 00:46:50 +0500 Subject: [PATCH] Allocate less memory in AddrForKey This backports the microoptimization fix initially introduced in [1]. [1]: https://github.com/yggdrasil-network/yggdrasil-go/pull/801 --- crypto.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto.go b/crypto.go index 227abc0..25e6875 100644 --- a/crypto.go +++ b/crypto.go @@ -28,7 +28,7 @@ func AddrForKey(key ed25519.PublicKey) *address.Address { buf[idx] = ^buf[idx] } var addr address.Address - var temp = make([]byte, 0, 128) + var temp = make([]byte, 0, 32) done := false ones := byte(0) bits := byte(0)