From a7d2b780d0ecea60bf21bfdf2ce4f87e16e1863c Mon Sep 17 00:00:00 2001 From: Igor Putovny Date: Fri, 13 Oct 2023 15:26:03 +0200 Subject: [PATCH] Simplify delete_trie() function --- proto/aggregator/aggregator.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/proto/aggregator/aggregator.c b/proto/aggregator/aggregator.c index aeca2019..4ee183b0 100644 --- a/proto/aggregator/aggregator.c +++ b/proto/aggregator/aggregator.c @@ -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); } /*