tsdb: re-use iterator when stepping through chunks

Saves memory allocations, hence reduces garbage-collection overheads.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2022-12-22 17:01:47 +00:00
parent ccea61c7bf
commit 1848623c77
1 changed files with 1 additions and 1 deletions

View File

@ -682,7 +682,7 @@ func (p *populateWithDelSeriesIterator) Next() chunkenc.ValueType {
if p.currDelIter != nil { if p.currDelIter != nil {
p.curr = p.currDelIter p.curr = p.currDelIter
} else { } else {
p.curr = p.currChkMeta.Chunk.Iterator(nil) p.curr = p.currChkMeta.Chunk.Iterator(p.curr)
} }
if valueType := p.curr.Next(); valueType != chunkenc.ValNone { if valueType := p.curr.Next(); valueType != chunkenc.ValNone {
return valueType return valueType