mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 01:43:47 +00:00
refactor: using slices.Contains to simplify the code
Signed-off-by: kindknow <iturf@sina.com>
This commit is contained in:
parent
341647f186
commit
f9d426b0a1
1 changed files with 2 additions and 6 deletions
|
|
@ -19,6 +19,7 @@ package native
|
|||
import (
|
||||
"encoding/json"
|
||||
"math/big"
|
||||
"slices"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
|
||||
|
|
@ -75,12 +76,7 @@ func newFourByteTracer(ctx *tracers.Context, cfg json.RawMessage, chainConfig *p
|
|||
|
||||
// isPrecompiled returns whether the addr is a precompile. Logic borrowed from newJsTracer in eth/tracers/js/tracer.go
|
||||
func (t *fourByteTracer) isPrecompiled(addr common.Address) bool {
|
||||
for _, p := range t.activePrecompiles {
|
||||
if p == addr {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(t.activePrecompiles, addr)
|
||||
}
|
||||
|
||||
// store saves the given identifier and datasize.
|
||||
|
|
|
|||
Loading…
Reference in a new issue