Skip to content

Commit

Permalink
Fix "slice bounds out of range" error in memoryMetric.selectPoints()
Browse files Browse the repository at this point in the history
  • Loading branch information
fedor-cariad committed Aug 31, 2021
1 parent 9034eef commit 98ca6d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memory_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ func (m *memoryMetric) selectPoints(start, end int64) []*DataPoint {
} else {
// Use binary search because points are in-order.
endIdx = sort.Search(int(size), func(i int) bool {
return m.points[i].Timestamp < end
}) + 1
return m.points[i].Timestamp > end
})
}
return m.points[startIdx:endIdx]
}
Expand Down

0 comments on commit 98ca6d3

Please sign in to comment.