Match rstl::lower_bound

Thanks Antidote


Former-commit-id: 8dc42490e5
This commit is contained in:
Henrique Gemignani Passos Lima 2022-12-07 18:46:34 +02:00
parent 9e408418a1
commit 28e9710502
1 changed files with 1 additions and 1 deletions

View File

@ -100,8 +100,8 @@ It lower_bound(It start, It end, const T& value, Cmp cmp) {
int dist = distance(start, end); int dist = distance(start, end);
It it = start; It it = start;
while (dist > 0) { while (dist > 0) {
it = start;
int halfDist = dist / 2; int halfDist = dist / 2;
it = start;
advance(it, halfDist); advance(it, halfDist);
if (cmp(*it, value)) { if (cmp(*it, value)) {
start = it; start = it;