From 5ba6aed7c959cabde250694813ddffeed5e05902 Mon Sep 17 00:00:00 2001 From: cuiweixie Date: Sat, 18 Oct 2025 20:03:12 +0800 Subject: [PATCH] core/types: prealloc map in HashDifference as in TxDifference --- 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 be8e90364e..e98563b85f 100644 --- a/core/types/transaction.go +++ b/core/types/transaction.go @@ -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{}{} }