mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 20:46:40 +00:00
core/types: prealloc map in HashDifference as in TxDifference (#32946)
This commit is contained in:
parent
11c0fb98af
commit
69df6bb8d5
1 changed files with 1 additions and 1 deletions
|
|
@ -648,7 +648,7 @@ func TxDifference(a, b Transactions) Transactions {
|
||||||
func HashDifference(a, b []common.Hash) []common.Hash {
|
func HashDifference(a, b []common.Hash) []common.Hash {
|
||||||
keep := make([]common.Hash, 0, len(a))
|
keep := make([]common.Hash, 0, len(a))
|
||||||
|
|
||||||
remove := make(map[common.Hash]struct{})
|
remove := make(map[common.Hash]struct{}, len(b))
|
||||||
for _, hash := range b {
|
for _, hash := range b {
|
||||||
remove[hash] = struct{}{}
|
remove[hash] = struct{}{}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue