Match rstl::lower_bound

Thanks Antidote
This commit is contained in:
Henrique Gemignani Passos Lima 2022-12-07 18:46:34 +02:00
parent 71c27ee7fc
commit 8dc42490e5
No known key found for this signature in database
GPG Key ID: E224F951761145F8
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;