mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-01-03 15:41:54 +00:00
Replace goto with else
This commit is contained in:
parent
b572ad323d
commit
6270714fd0
@ -98,16 +98,17 @@ remove_node(struct trie_node *node)
|
|||||||
assert(node->child[0] == NULL && node->child[1] == NULL);
|
assert(node->child[0] == NULL && node->child[1] == NULL);
|
||||||
|
|
||||||
if (node->parent == NULL)
|
if (node->parent == NULL)
|
||||||
goto free_node;
|
;
|
||||||
|
else
|
||||||
|
{
|
||||||
if (node->parent->child[0] == node)
|
if (node->parent->child[0] == node)
|
||||||
node->parent->child[0] = NULL;
|
node->parent->child[0] = NULL;
|
||||||
else if (node->parent->child[1] == node)
|
else if (node->parent->child[1] == node)
|
||||||
node->parent->child[1] = NULL;
|
node->parent->child[1] = NULL;
|
||||||
else
|
else
|
||||||
bug("Invalid child pointer");
|
bug("Invalid child pointer");
|
||||||
|
}
|
||||||
|
|
||||||
free_node:
|
|
||||||
sl_free(node);
|
sl_free(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user