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