summaryrefslogtreecommitdiffstats
path: root/src/btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/btree.c b/src/btree.c
index d824c23..a73a2d0 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -895,13 +895,14 @@ zix_btree_lower_bound(const ZixBTree* const t,
return ZIX_STATUS_SUCCESS;
}
- assert(ti->indexes[ti->level] == ti->nodes[ti->level]->n_vals);
- if (found) {
- // Found on a previous level but went too far
- ti->level = found_level;
- } else {
- // Reached end (key is greater than everything in tree)
- *ti = zix_btree_end_iter;
+ if (ti->indexes[ti->level] == ti->nodes[ti->level]->n_vals) {
+ if (found) {
+ // Found on a previous level but went too far
+ ti->level = found_level;
+ } else {
+ // Reached end (key is greater than everything in tree)
+ *ti = zix_btree_end_iter;
+ }
}
return ZIX_STATUS_SUCCESS;