rbtree: place easiest case first in rb_erase()
authorMichel Lespinasse <walken@google.com>
Wed, 3 Jan 2018 11:41:29 +0000 (12:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 3 Jan 2018 11:41:29 +0000 (12:41 +0100)
commita6b1da2915b195cda66026e1024dc54375da08b4
treeda0721332615a0534bd5bcb1d0a858401f0a1c27
parent22eecde9ebb38b3ae0a5040189750ab9b6476360
rbtree: place easiest case first in rb_erase()

In rb_erase, move the easy case (node to erase has no more than
1 child) first. I feel the code reads easier that way.

Signed-off-by: Michel Lespinasse <walken@google.com>
Reviewed-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[Linux commit 60670b8034d6e2ba860af79c9379b7788d09db73]

Ported to Xen.

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