diff options
author | Sebastian Geerken <devnull@localhost> | 2013-05-29 15:58:46 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-05-29 15:58:46 +0200 |
commit | 425e2d4d38d9fa566132363cbb51a83258f710e9 (patch) | |
tree | 7c81b2dfe7e7372d9cafe0e88bec085809efdda2 /lout/container.cc | |
parent | e2ee1a5c85aedf85a2dbfa1eea046d4e34847bf9 (diff) |
Fixed a bug in Vector::bsearch (empty vector).
Diffstat (limited to 'lout/container.cc')
-rw-r--r-- | lout/container.cc | 5 |
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; |