diff options
-rw-r--r-- | src/rbtree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/rbtree.c b/src/rbtree.c index afbdca64..4e7c0f3a 100644 --- a/src/rbtree.c +++ b/src/rbtree.c @@ -248,15 +248,15 @@ void rb_erase(struct rb_node *node, struct rb_root *root) if (child) rb_set_parent(child, parent); parent->rb_left = child; + + node->rb_right = old->rb_right; + rb_set_parent(old->rb_right, node); } node->rb_parent_color = old->rb_parent_color; - node->rb_right = old->rb_right; node->rb_left = old->rb_left; - rb_set_parent(old->rb_left, node); - if (old->rb_right) - rb_set_parent(old->rb_right, node); + goto color; } |