Commit 5d728194 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Undo BPTree simplification.

parent 460ad13d
Pipeline #1682 passed with stages
in 1 minute and 33 seconds
......@@ -1062,7 +1062,14 @@ void *BPTree_get_first_in_range(BPTreeNode *root, BPTreeKey_t key_start, BPTreeK
if (n == NULL) return NULL;
for (i = 0; i < n->num_keys && n->keys[i] < key_start; i++);
if (i == n->num_keys) return NULL;
return ((BPTreeRecord *) n->pointers[i])->value;
while (n != NULL) {
for (; i < n->num_keys && n->keys[i] <= key_end; i++) {
return ((BPTreeRecord *) n->pointers[i])->value;
}
n = n->pointers[order - 1];
i = 0;
}
return NULL;
}
uint32_t BPTree_size(BPTreeNode *root) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment