From 27edb42dc00ec8d3176dacaf94e332cd75d8f459 Mon Sep 17 00:00:00 2001 From: Nodar Ambroladze Date: Tue, 23 Apr 2024 11:18:33 +0200 Subject: [PATCH] Cast bytes to fixed size array instead of copying --- gethhook/geth-hook.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gethhook/geth-hook.go b/gethhook/geth-hook.go index dcd1788710..08b96b384f 100644 --- a/gethhook/geth-hook.go +++ b/gethhook/geth-hook.go @@ -58,9 +58,7 @@ func init() { precompileErrors := make(map[[4]byte]abi.Error) for addr, precompile := range precompiles.Precompiles() { for _, errABI := range precompile.Precompile().GetErrorABIs() { - var id [4]byte - copy(id[:], errABI.ID[:4]) - precompileErrors[id] = errABI + precompileErrors[[4]byte(errABI.ID.Bytes())] = errABI } var wrapped vm.AdvancedPrecompile = ArbosPrecompileWrapper{precompile} vm.PrecompiledContractsArbitrum[addr] = wrapped