aboutsummaryrefslogtreecommitdiff
path: root/lout/container.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lout/container.cc')
-rw-r--r--lout/container.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lout/container.cc b/lout/container.cc
index 7197ba74..908df4ae 100644
--- a/lout/container.cc
+++ b/lout/container.cc
@@ -208,8 +208,9 @@ int Vector::bsearch(Object *key, bool mustExist, int start, int end,
{
// The case !mustExist is not handled by bsearch(3), so here is a
// new implementation.
- if (start >= end)
- return mustExist ? -1 : 0;
+
+ if (start > end)
+ return mustExist ? -1 : start;
int low = start, high = end;