mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Simply loop away from using tracking variables.
Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
This commit is contained in:
parent
5d2e72269b
commit
c1939b7136
14
querier.go
14
querier.go
|
@ -413,12 +413,15 @@ func (s *populatedChunkSeries) Next() bool {
|
||||||
for s.set.Next() {
|
for s.set.Next() {
|
||||||
lset, chks := s.set.At()
|
lset, chks := s.set.At()
|
||||||
|
|
||||||
from := -1
|
for len(chks) > 0 {
|
||||||
for i, c := range chks {
|
if chks[0].MaxTime >= s.mint {
|
||||||
if c.MaxTime < s.mint {
|
break
|
||||||
from = i
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
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 {
|
if c.MinTime > s.maxt {
|
||||||
chks = chks[:i]
|
chks = chks[:i]
|
||||||
break
|
break
|
||||||
|
@ -429,7 +432,6 @@ func (s *populatedChunkSeries) Next() bool {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chks = chks[from+1:]
|
|
||||||
if len(chks) == 0 {
|
if len(chks) == 0 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue