From c79850764227da2d514201f8e5f93bb56e8f81b3 Mon Sep 17 00:00:00 2001 From: ucwong Date: Tue, 9 May 2023 01:24:43 -0600 Subject: [PATCH] miner: initialize maps with capacity (#27228) * miner : initialize maps with known size * miner:some reverts --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index 9afc65ab1..936a9e74a 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -628,7 +628,7 @@ func (w *worker) mainLoop() { if gp := w.current.gasPool; gp != nil && gp.Gas() < params.TxGas { continue } - txs := make(map[common.Address]types.Transactions) + txs := make(map[common.Address]types.Transactions, len(ev.Txs)) for _, tx := range ev.Txs { acc, _ := types.Sender(w.current.signer, tx) txs[acc] = append(txs[acc], tx)