mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-04 14:08:39 +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
|
// add or update filter rows
|
||||||
for rowIndex := uint32(0); rowIndex < r.f.mapHeight; rowIndex++ {
|
for rowIndex := uint32(0); rowIndex < r.f.mapHeight; rowIndex++ {
|
||||||
var (
|
capacity := len(r.finishedMaps)
|
||||||
mapIndices []uint32
|
|
||||||
rows []FilterRow
|
mapIndices := make([]uint32, 0, capacity)
|
||||||
)
|
rows := make([]FilterRow, 0, capacity)
|
||||||
for mapIndex := range r.finished.Iter() {
|
for mapIndex := range r.finished.Iter() {
|
||||||
row := r.finishedMaps[mapIndex].filterMap[rowIndex]
|
row := r.finishedMaps[mapIndex].filterMap[rowIndex]
|
||||||
if fm, _ := r.f.filterMapCache.Get(mapIndex); fm != nil && row.Equal(fm[rowIndex]) {
|
if fm, _ := r.f.filterMapCache.Get(mapIndex); fm != nil && row.Equal(fm[rowIndex]) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue