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:
Oleg Zaytsev 2024-07-02 15:51:05 +02:00 committed by GitHub
parent 9cf4b969dd
commit 726ed124e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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:]