Welcome! Log In Create A New Profile

Advanced

[nginx] Core: removed dead code in ngx_rbtree_delete().

Vladimir Homutov
September 30, 2019 09:50AM
details: https://hg.nginx.org/nginx/rev/7fdcf308e0f0
branches:
changeset: 7576:7fdcf308e0f0
user: Vladimir Homutov <vl@nginx.com>
date: Mon Sep 30 16:39:20 2019 +0300
description:
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.

diffstat:

src/core/ngx_rbtree.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)

diffs (17 lines):

diff -r d34a81b49214 -r 7fdcf308e0f0 src/core/ngx_rbtree.c
--- a/src/core/ngx_rbtree.c Mon Sep 30 16:43:16 2019 +0300
+++ b/src/core/ngx_rbtree.c Mon Sep 30 16:39:20 2019 +0300
@@ -174,12 +174,7 @@ ngx_rbtree_delete(ngx_rbtree_t *tree, ng

} 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) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Core: removed dead code in ngx_rbtree_delete().

Vladimir Homutov 84 September 30, 2019 09:50AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 83
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready