rbtree: remove redundant if()-condition in rb_erase()
authorWolfram Strepp <wstrepp@gmx.de>
Wed, 20 Dec 2017 17:00:49 +0000 (18:00 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Dec 2017 17:00:49 +0000 (18:00 +0100)
commitbd9cc37a040425551b6e5fe0dea87623635aca3e
tree2bdae3047d13bdd2d35a17fc038cd004f3d5b0fb
parent5df4fe36c1b0361c12920651eaf3628422197f21
rbtree: remove redundant if()-condition in rb_erase()

Furthermore, notice that the initial checks:

            if (!node->rb_left)
                    child = node->rb_right;
            else if (!node->rb_right)
                    child = node->rb_left;
            else
            {
                    ...
            }
guarantee that old->rb_right is set in the final else branch, therefore
we can omit checking that again.

Signed-off-by: Wolfram Strepp <wstrepp@gmx.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[Linux commit 4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee]

Ported to Xen.

Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/common/rbtree.c