Simply loop away from using tracking variables.

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
Goutham Veeramachaneni 2017-05-05 19:34:59 +05:30
parent 5d2e72269b
commit c1939b7136
No known key found for this signature in database
GPG key ID: F1C217E8E9023CAD

View file

@ -413,12 +413,15 @@ func (s *populatedChunkSeries) Next() bool {
for s.set.Next() {
lset, chks := s.set.At()
from := -1
for i, c := range chks {
if c.MaxTime < s.mint {
from = i
continue
for len(chks) > 0 {
if chks[0].MaxTime >= s.mint {
break
}
chks = chks[1:]
}
// Break out at the first chunk that has no overlap with mint, maxt.
for i, c := range chks {
if c.MinTime > s.maxt {
chks = chks[:i]
break
@ -429,7 +432,6 @@ func (s *populatedChunkSeries) Next() bool {
}
}
chks = chks[from+1:]
if len(chks) == 0 {
continue
}