mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-24 08:49:29 +00:00
core/filtermaps: preallocate slices in writeFinishedMaps
This commit is contained in:
parent
d318e8eba9
commit
54e9cc8957
1 changed files with 4 additions and 4 deletions
|
|
@ -426,10 +426,10 @@ func (r *mapRenderer) writeFinishedMaps(pauseCb func() bool) error {
|
|||
}
|
||||
// add or update filter rows
|
||||
for rowIndex := uint32(0); rowIndex < r.f.mapHeight; rowIndex++ {
|
||||
var (
|
||||
mapIndices []uint32
|
||||
rows []FilterRow
|
||||
)
|
||||
capacity := len(r.finishedMaps)
|
||||
|
||||
mapIndices := make([]uint32, 0, capacity)
|
||||
rows := make([]FilterRow, 0, capacity)
|
||||
for mapIndex := range r.finished.Iter() {
|
||||
row := r.finishedMaps[mapIndex].filterMap[rowIndex]
|
||||
if fm, _ := r.f.filterMapCache.Get(mapIndex); fm != nil && row.Equal(fm[rowIndex]) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue