mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
pre alloc capacity for logs list
This commit is contained in:
parent
b369a855fb
commit
7e910ed0d7
1 changed files with 1 additions and 1 deletions
|
|
@ -258,7 +258,7 @@ func (s *StateDB) GetLogs(hash common.Hash, blockNumber uint64, blockHash common
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *StateDB) Logs() []*types.Log {
|
func (s *StateDB) Logs() []*types.Log {
|
||||||
var logs []*types.Log
|
logs := make([]*types.Log, 0, s.logSize)
|
||||||
for _, lgs := range s.logs {
|
for _, lgs := range s.logs {
|
||||||
logs = append(logs, lgs...)
|
logs = append(logs, lgs...)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue