From 8dc42490e540c00522e85f9cc06b3aae8ea98a6b Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Wed, 7 Dec 2022 18:46:34 +0200 Subject: [PATCH] Match rstl::lower_bound Thanks Antidote --- include/rstl/algorithm.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rstl/algorithm.hpp b/include/rstl/algorithm.hpp index 6df998bc..c1722072 100644 --- a/include/rstl/algorithm.hpp +++ b/include/rstl/algorithm.hpp @@ -100,8 +100,8 @@ It lower_bound(It start, It end, const T& value, Cmp cmp) { int dist = distance(start, end); It it = start; while (dist > 0) { - it = start; int halfDist = dist / 2; + it = start; advance(it, halfDist); if (cmp(*it, value)) { start = it;