0
0
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:
Igor Putovny 2024-05-17 12:48:03 +02:00
parent b572ad323d
commit 6270714fd0

View File

@ -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);
} }