Skip to content

Commit 64a7605

Browse files
authored
Revert "Fix end in select in some cases was inclusive (#54)" (#68)
This reverts commit 7e4b396.
1 parent 7e4b396 commit 64a7605

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

memory_partition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (m *memoryMetric) selectPoints(start, end int64) []*DataPoint {
233233
})
234234
}
235235

236-
if end > maxTimestamp {
236+
if end >= maxTimestamp {
237237
endIdx = int(size)
238238
} else {
239239
// Use binary search because points are in-order.

memory_partition_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func Test_memoryPartition_SelectDataPoints(t *testing.T) {
8787
name: "select some points",
8888
metric: "metric1",
8989
start: 2,
90-
end: 5,
90+
end: 4,
9191
memoryPartition: func() *memoryPartition {
9292
m := newMemoryPartition(nil, 0, "").(*memoryPartition)
9393
m.insertRows([]Row{
@@ -117,7 +117,6 @@ func Test_memoryPartition_SelectDataPoints(t *testing.T) {
117117
want: []*DataPoint{
118118
{Timestamp: 2, Value: 0.1},
119119
{Timestamp: 3, Value: 0.1},
120-
{Timestamp: 4, Value: 0.1},
121120
},
122121
},
123122
{

0 commit comments

Comments
 (0)