Skip to content

Commit

Permalink
art_iterator_lower_bound works on empty bitmap64
Browse files Browse the repository at this point in the history
When we reset the iterator to the root, check if the root is null
  • Loading branch information
Dr-Emann committed Jun 27, 2024
1 parent 35e446c commit d292fd3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/art/art.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,8 +1693,11 @@ bool art_iterator_lower_bound(art_iterator_t *iterator,
// a valid key. Start from the root.
iterator->frame = 0;
iterator->depth = 0;
return art_node_iterator_lower_bound(art_iterator_node(iterator),
iterator, key);
art_node_t *root = art_iterator_node(iterator);
if (root == NULL) {
return false;
}
return art_node_iterator_lower_bound(root, iterator, key);
}
int compare_result =
art_compare_prefix(iterator->key, 0, key, 0, ART_KEY_BYTES);
Expand Down

0 comments on commit d292fd3

Please sign in to comment.