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