set capacity of txsmap (#2166)
This commit is contained in:
parent
ec3e34efd8
commit
e1b9bf7c81
|
@ -401,7 +401,7 @@ func (mem *Mempool) collectTxs(maxTxs int) types.Txs {
|
|||
// NOTE: unsafe; Lock/Unlock must be managed by caller
|
||||
func (mem *Mempool) Update(height int64, txs types.Txs) error {
|
||||
// First, create a lookup map of txns in new txs.
|
||||
txsMap := make(map[string]struct{})
|
||||
txsMap := make(map[string]struct{}, len(txs))
|
||||
for _, tx := range txs {
|
||||
txsMap[string(tx)] = struct{}{}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue