mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
rbtree: fix rbtree_find_first_larger_equal
This commit is contained in:
@@ -94,7 +94,7 @@ rbtree_t *rbtree_find_first_larger_equal(rbtree_t *rbtree, void *key, rbtree_val
|
|||||||
if (comparison == 0)
|
if (comparison == 0)
|
||||||
return rbtree;
|
return rbtree;
|
||||||
|
|
||||||
if (comparison == 1 && (found == NULL || compare_fn(found, rbtree) > 0))
|
if (comparison == -1)
|
||||||
found = rbtree;
|
found = rbtree;
|
||||||
|
|
||||||
rbtree = comparison == 1 ? rbtree->right : rbtree->left;
|
rbtree = comparison == 1 ? rbtree->right : rbtree->left;
|
||||||
|
|||||||
Reference in New Issue
Block a user