rb_tree: remove redundant if()-condition in rb_erase()
authorWolfram Strepp <wstrepp@gmx.de>
Tue, 16 Jun 2009 22:34:13 +0000 (15:34 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 17 Jun 2009 02:47:56 +0000 (19:47 -0700)
commit4b324126e0c6c3a5080ca3ec0981e8766ed6f1ee
treef49edd4acf4963eb3377fd3a700982081970ba14
parent4c60117811171d867d4f27f17ea07d7419d45dae
rb_tree: 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>
lib/rbtree.c