mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
eth/tracers/logger: using maps.Equal
This commit is contained in:
parent
767b00b0b5
commit
560a12b182
1 changed files with 2 additions and 9 deletions
|
|
@ -21,6 +21,7 @@ import (
|
|||
"github.com/ethereum/go-ethereum/core/tracing"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/ethereum/go-ethereum/core/vm"
|
||||
"maps"
|
||||
)
|
||||
|
||||
// accessList is an accumulator for the set of accounts and storage slots an EVM
|
||||
|
|
@ -71,17 +72,9 @@ func (al accessList) equal(other accessList) bool {
|
|||
// Accounts match, cross reference the storage slots too
|
||||
for addr, slots := range al {
|
||||
otherslots := other[addr]
|
||||
|
||||
if len(slots) != len(otherslots) {
|
||||
if !maps.Equal(slots, otherslots) {
|
||||
return false
|
||||
}
|
||||
// Given that len(slots) == len(otherslots), we only need to check that
|
||||
// all the items from slots are in otherslots.
|
||||
for hash := range slots {
|
||||
if _, ok := otherslots[hash]; !ok {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue