/* setting a NULL node to black is a nop */
static inline void trbt_set_color(trbt_node_t *node, int color)
{
- if ( (node==NULL) && (color==TRBT_BLACK) ) {
+ if (node == NULL) {
return;
}
node->rb_color = color;
This is simple since this dummy node originally had no children
and we are guaranteed that it will also not have any children
after the node has been deleted and any possible rotations
- have occured.
+ have occurred.
The only special case is if this was the last node of the tree
in which case we have to reset the root to NULL as well.