From 3cac4f865bf7af6c9fbaf24320e998589ed1e96b Mon Sep 17 00:00:00 2001 From: wit Date: Wed, 22 Oct 2025 10:15:46 +0800 Subject: [PATCH] core/types: prealloc map in HashDifference as in TxDifference #32946 --- core/types/transaction.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/types/transaction.go b/core/types/transaction.go index 25e5edaef96e..a8f3ac2a9c86 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -627,7 +627,7 @@ func TxDifference(a, b Transactions) (keep 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{}{} }