[PATCH v2 09/12] rbtree: adjust node color in __rb_erase_color() only when necessary

2012-07-12 Thread Michel Lespinasse
In __rb_erase_color(), we were always setting a node to black after exiting the main loop. And in one case, after fixing up the tree to satisfy all rbtree invariants, we were setting the current node to root just to guarantee a loop exit, at which point the root would be set to black. However this

[PATCH v2 09/12] rbtree: adjust node color in __rb_erase_color() only when necessary

2012-07-12 Thread Michel Lespinasse
In __rb_erase_color(), we were always setting a node to black after exiting the main loop. And in one case, after fixing up the tree to satisfy all rbtree invariants, we were setting the current node to root just to guarantee a loop exit, at which point the root would be set to black. However this