Skip to content

Commit f0ba932

Browse files
committed
Remove unnecessary 'end' member from bigchunk
It is only used to shortcut the case where FindAtOrAfter() is called with a target past the end of the chunk, and this never happens because we have from/through times on each chunk at a higher level. Signed-off-by: Bryan Boreham <bryan@weave.works>
1 parent b2e700e commit f0ba932

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pkg/chunk/encoding/bigchunk.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ type smallChunk struct {
2323
// upperbound on number of samples it can contain.
2424
type bigchunk struct {
2525
chunks []smallChunk
26-
end int64
2726

2827
appender chunkenc.Appender
2928
remainingSamples int
@@ -45,7 +44,6 @@ func (b *bigchunk) Add(sample model.SamplePair) ([]Chunk, error) {
4544

4645
b.appender.Append(int64(sample.Timestamp), float64(sample.Value))
4746
b.remainingSamples--
48-
b.end = int64(sample.Timestamp)
4947
return []Chunk{b}, nil
5048
}
5149

@@ -248,7 +246,7 @@ type bigchunkIterator struct {
248246
}
249247

250248
func (it *bigchunkIterator) FindAtOrAfter(target model.Time) bool {
251-
if it.i >= len(it.chunks) || int64(target) > it.end {
249+
if it.i >= len(it.chunks) {
252250
return false
253251
}
254252

0 commit comments

Comments
 (0)