From 6a7a0a43f66ae9add076ccc55b859197567f879a Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 3 Sep 2021 15:45:14 +0200 Subject: [PATCH] code cleanup --- src/libgame/setup.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 60ec59f3..f1223d0d 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -1301,17 +1301,14 @@ static TreeInfo *getValidTreeInfoEntryExt(TreeInfo *node, boolean get_next_node) if (node->parent_link) // skip first node (back link) of node group get_next_node = TRUE; - if (get_next_node) - { - // get next regular tree node, or step up until one is found - while (node->next == NULL && node->node_parent != NULL) - node = node->node_parent; + if (!get_next_node) // get current regular tree node + return node; - return getFirstValidTreeInfoEntry(node->next); - } + // get next regular tree node, or step up until one is found + while (node->next == NULL && node->node_parent != NULL) + node = node->node_parent; - // this is a regular tree node - return node; + return getFirstValidTreeInfoEntry(node->next); } TreeInfo *getFirstValidTreeInfoEntry(TreeInfo *node) -- 2.34.1