From c1215992fed2e227e297b53babab35123086c061 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sat, 26 Mar 2022 08:55:32 -0400 Subject: [PATCH] use inline API for node removal --- src/lib/server/cf_util.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/lib/server/cf_util.c b/src/lib/server/cf_util.c index 8715573dd0..b1b03afdbe 100644 --- a/src/lib/server/cf_util.c +++ b/src/lib/server/cf_util.c @@ -404,17 +404,9 @@ CONF_ITEM *_cf_item_remove(CONF_ITEM *parent, CONF_ITEM *child) */ fr_dlist_remove(&parent->children, child); - in_ident1 = (fr_rb_find(parent->ident1, child) == child); - if (in_ident1 && (!fr_rb_delete(parent->ident1, child))) { - fr_assert(0); - return NULL; - } + in_ident1 = (fr_rb_remove_by_inline_node(parent->ident1, &child->ident1_node) != NULL); + in_ident2 = (fr_rb_remove_by_inline_node(parent->ident2, &child->ident2_node) != NULL); - in_ident2 = (fr_rb_find(parent->ident2, child) == child); - if (in_ident2 && (!fr_rb_delete(parent->ident2, child))) { - fr_assert(0); - return NULL; - } /* * Look for twins. They weren't in the tree initially, -- 2.47.2