[PATCH 11/13] rbtree: optimize case selection logic in __rb_erase_color()

2012-07-09 Thread Michel Lespinasse
In __rb_erase_color(), we have to select one of 3 cases depending on the color on the 'other' node children. If both children are black, we flip a few node colors and iterate. Otherwise, we do either one or two tree rotations, depending on the color of the 'other' child opposite to 'node', and

[PATCH 11/13] rbtree: optimize case selection logic in __rb_erase_color()

2012-07-09 Thread Michel Lespinasse
In __rb_erase_color(), we have to select one of 3 cases depending on the color on the 'other' node children. If both children are black, we flip a few node colors and iterate. Otherwise, we do either one or two tree rotations, depending on the color of the 'other' child opposite to 'node', and