diff options
-rw-r--r-- | lib/rbtree.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/rbtree.c b/lib/rbtree.c index 14b791ac5089..63473e04f18a 100644 --- a/lib/rbtree.c +++ b/lib/rbtree.c | |||
@@ -243,18 +243,13 @@ void rb_erase(struct rb_node *node, struct rb_root *root) | |||
243 | 243 | ||
244 | if (child) | 244 | if (child) |
245 | child->rb_parent = parent; | 245 | child->rb_parent = parent; |
246 | if (parent) | ||
247 | { | ||
248 | if (parent->rb_left == node) | ||
249 | parent->rb_left = child; | ||
250 | else | ||
251 | parent->rb_right = child; | ||
252 | } | ||
253 | else | ||
254 | root->rb_node = child; | ||
255 | 246 | ||
256 | if (node->rb_parent == old) | 247 | if (node->rb_parent == old) { |
248 | parent->rb_right = child; | ||
257 | parent = node; | 249 | parent = node; |
250 | } else | ||
251 | parent->rb_left = child; | ||
252 | |||
258 | node->rb_parent = old->rb_parent; | 253 | node->rb_parent = old->rb_parent; |
259 | node->rb_color = old->rb_color; | 254 | node->rb_color = old->rb_color; |
260 | node->rb_right = old->rb_right; | 255 | node->rb_right = old->rb_right; |