Skip to content

Commit

Permalink
Core: removed dead code in ngx_rbtree_delete().
Browse files Browse the repository at this point in the history
The result of ngx_rbtree_min() is always a node with the left child equal to
sentinel, thus the check is unnecessary.
  • Loading branch information
vlhomutov committed Sep 30, 2019
1 parent 201062c commit f7999fe
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/core/ngx_rbtree.c
Expand Up @@ -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) {
Expand Down

0 comments on commit f7999fe

Please sign in to comment.