mirror of
https://github.com/prometheus/prometheus.git
synced 2025-02-02 08:31:11 -08:00
Replace ListPostings.Seek
's binary search call by the generic slices.BinarySearch
(#14393)
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
9cf4b969dd
commit
726ed124e4
|
@ -755,9 +755,7 @@ func (it *ListPostings) Seek(x storage.SeriesRef) bool {
|
|||
}
|
||||
|
||||
// Do binary search between current position and end.
|
||||
i := sort.Search(len(it.list), func(i int) bool {
|
||||
return it.list[i] >= x
|
||||
})
|
||||
i, _ := slices.BinarySearch(it.list, x)
|
||||
if i < len(it.list) {
|
||||
it.cur = it.list[i]
|
||||
it.list = it.list[i+1:]
|
||||
|
|
Loading…
Reference in a new issue