(libretro-db) Simplify bintree.c
This commit is contained in:
parent
7baa166adc
commit
ffec5bf83d
|
@ -50,21 +50,6 @@ static int insert(bintree_t *t, struct bintree_node *root, void *value)
|
||||||
{
|
{
|
||||||
root->left = new_nil_node(root);
|
root->left = new_nil_node(root);
|
||||||
root->right = new_nil_node(root);
|
root->right = new_nil_node(root);
|
||||||
|
|
||||||
if (!root->left || !root->right)
|
|
||||||
{
|
|
||||||
if (root->left)
|
|
||||||
{
|
|
||||||
free(root->left);
|
|
||||||
root->left = NULL;
|
|
||||||
}
|
|
||||||
if (root->right)
|
|
||||||
{
|
|
||||||
free(root->right);
|
|
||||||
root->right = NULL;
|
|
||||||
}
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
root->value = value;
|
root->value = value;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue