mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-20 11:46:44 +00:00
core/rawdb: preallocate slice in iterateTransactions
This commit is contained in:
parent
181a3ae9e0
commit
7ce4b1b82a
1 changed files with 3 additions and 3 deletions
|
|
@ -153,9 +153,9 @@ func iterateTransactions(db ethdb.Database, from uint64, to uint64, reverse bool
|
||||||
err: err,
|
err: err,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
var hashes []common.Hash
|
hashes := make([]common.Hash, len(body.Transactions))
|
||||||
for _, tx := range body.Transactions {
|
for i, tx := range body.Transactions {
|
||||||
hashes = append(hashes, tx.Hash())
|
hashes[i] = tx.Hash()
|
||||||
}
|
}
|
||||||
result = &blockTxHashes{
|
result = &blockTxHashes{
|
||||||
hashes: hashes,
|
hashes: hashes,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue