summaryrefslogtreecommitdiffstats
path: root/zix/sorted_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'zix/sorted_array.c')
-rw-r--r--zix/sorted_array.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/zix/sorted_array.c b/zix/sorted_array.c
index ffab77c..c96ea2b 100644
--- a/zix/sorted_array.c
+++ b/zix/sorted_array.c
@@ -151,7 +151,9 @@ zix_sorted_array_find(const ZixSortedArray* a,
if (cmp == 0) {
*ai = elem_i;
return ZIX_STATUS_SUCCESS;
- } else if (cmp > 0) {
+ }
+
+ if (cmp > 0) {
upper = i - 1;
} else {
lower = i + 1;