From 69df6bb8d59027f617c6bf0a24f7af17c06cae39 Mon Sep 17 00:00:00 2001 From: cui Date: Mon, 20 Oct 2025 10:35:14 +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 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{}{} }