The t_rbtree_decide defines that lower nodes should be on let but I
consistently used the comparison function with the arguments switched so
the order was the other way around. This fixes it.
cmp_el = node->tree->cmp_el;
while (1)
{
- cmp_res = cmp_el(&node->data, element);
+ cmp_res = cmp_el(element, &node->data);
next = ft_rbtree_decide(node, cmp_res);
if (!next)
break ;
return (NULL);
while (1)
{
- cmp_res = cmp_el(&node->data, element);
+ cmp_res = cmp_el(element, &node->data);
next = ft_rbtree_decide(node, cmp_res);
if (!next)
break ;