mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +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,
|
||||
}
|
||||
} else {
|
||||
var hashes []common.Hash
|
||||
for _, tx := range body.Transactions {
|
||||
hashes = append(hashes, tx.Hash())
|
||||
hashes := make([]common.Hash, len(body.Transactions))
|
||||
for i, tx := range body.Transactions {
|
||||
hashes[i] = tx.Hash()
|
||||
}
|
||||
result = &blockTxHashes{
|
||||
hashes: hashes,
|
||||
|
|
|
|||
Loading…
Reference in a new issue