Skip to content

Commit

Permalink
Cast bytes to fixed size array instead of copying
Browse files Browse the repository at this point in the history
  • Loading branch information
anodar committed Apr 23, 2024
1 parent c36c60f commit 27edb42
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gethhook/geth-hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27edb42

Please sign in to comment.