core/types: prealloc map in HashDifference as in TxDifference (#32946)

This commit is contained in:
cui 2025-10-20 10:35:14 +08:00 committed by GitHub
parent 11c0fb98af
commit 69df6bb8d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -648,7 +648,7 @@ func TxDifference(a, b Transactions) Transactions {
func HashDifference(a, b []common.Hash) []common.Hash {
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 {
remove[hash] = struct{}{}
}