From f3f0c4e76e16371536e906da81f063d76d3f6b6b Mon Sep 17 00:00:00 2001 From: Vladimir Homutov Date: Mon, 30 Sep 2019 16:39:20 +0300 Subject: [PATCH] Core: removed dead code in ngx_rbtree_delete(). The result of ngx_rbtree_min() is always a node with the left child equal to sentinel, thus the check is unnecessary. --- src/core/ngx_rbtree.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/core/ngx_rbtree.c b/src/core/ngx_rbtree.c index 969d549c8..377b82fcc 100644 --- a/src/core/ngx_rbtree.c +++ b/src/core/ngx_rbtree.c @@ -174,12 +174,7 @@ ngx_rbtree_delete(ngx_rbtree_t *tree, ngx_rbtree_node_t *node) } else { subst = ngx_rbtree_min(node->right, sentinel); - - if (subst->left != sentinel) { - temp = subst->left; - } else { - temp = subst->right; - } + temp = subst->right; } if (subst == *root) {