From ce7b5a42e82a8325a3a010fa832f442f47f9e6a9 Mon Sep 17 00:00:00 2001 From: Cyril Tovena Date: Fri, 2 Aug 2019 09:26:18 -0400 Subject: [PATCH] reuse overlapping array in batch iterator --- pkg/storage/iterator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/storage/iterator.go b/pkg/storage/iterator.go index e5d33fa397845..229a89d5b3055 100644 --- a/pkg/storage/iterator.go +++ b/pkg/storage/iterator.go @@ -150,7 +150,7 @@ func (it *batchChunkIterator) nextBatch() (iter.EntryIterator, error) { // // And nextChunk is # 49, we need to keep references to #47 and #48 as they won't be // iterated over completely (we're clipping through to #49's from) and then add them to the next batch. - it.lastOverlapping = []*chunkenc.LazyChunk{} + it.lastOverlapping = it.lastOverlapping[:0] for _, c := range batch { if it.req.Direction == logproto.BACKWARD { if c.Chunk.From.Before(nextChunk.Chunk.Through) || c.Chunk.From == nextChunk.Chunk.Through {