mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-08 12:18:42 +00:00
Simplify delete_trie() function
This commit is contained in:
parent
1cf73f74ac
commit
dca392e7c6
@ -122,12 +122,6 @@ delete_trie(struct trie_node *node)
|
||||
{
|
||||
assert(node != NULL);
|
||||
|
||||
if (is_leaf(node))
|
||||
{
|
||||
remove_node(node);
|
||||
return;
|
||||
}
|
||||
|
||||
if (node->child[0])
|
||||
delete_trie(node->child[0]);
|
||||
|
||||
@ -135,7 +129,7 @@ delete_trie(struct trie_node *node)
|
||||
delete_trie(node->child[1]);
|
||||
|
||||
assert(is_leaf(node));
|
||||
delete_trie(node);
|
||||
remove_node(node);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user