Skip to content

Commit 3f0e419

Browse files
committed
using next
Signed-off-by: Alan Protasio <[email protected]>
1 parent 782edb0 commit 3f0e419

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

pkg/querier/batch/batch.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,8 @@ func (a *iteratorAdapter) Seek(t int64) bool {
104104
} else if t <= a.underlying.MaxCurrentChunkTime() {
105105
// In this case, some timestamp inside the current underlying chunk can fulfill the seek.
106106
// In this case we will call next until we find the sample as it will be faster than calling seek directly.
107-
for a.underlying.Next(promchunk.BatchSize) {
108-
a.curr = a.underlying.Batch()
109-
if t <= a.curr.Timestamps[a.curr.Length-1] {
110-
//In this case, some timestamp between current sample and end of batch can fulfill
111-
//the seek. Let's find it.
112-
for a.curr.Index < a.curr.Length && t > a.curr.Timestamps[a.curr.Index] {
113-
a.curr.Index++
114-
}
107+
for a.Next() {
108+
if t <= a.curr.Timestamps[a.curr.Index] {
115109
return true
116110
}
117111
}

0 commit comments

Comments
 (0)