X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=rbtree.c;h=3cad749620a769b637d68c2dd277d244190b57ec;hp=ec8bdb1d42a72cc31e407a11898a04337fda8d1e;hb=cb73d5fa58cec287978337f5e186fff52bccd252;hpb=12265a5acd34b2b82529ac818ab61de5a0f650b6 diff --git a/rbtree.c b/rbtree.c index ec8bdb1..3cad749 100644 --- a/rbtree.c +++ b/rbtree.c @@ -2,7 +2,7 @@ Red Black Trees (C) 1999 Andrea Arcangeli (C) 2002 David Woodhouse - (C) 2007 Andre Noll + (C) 2007 Andre Noll This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -382,29 +382,6 @@ struct rb_node *rb_prev(const struct rb_node *node) return parent; } -void rb_replace_node(struct rb_node *victim, struct rb_node *new, - struct rb_root *root) -{ - struct rb_node *parent = rb_parent(victim); - - /* Set the surrounding nodes to point to the replacement */ - if (parent) { - if (victim == parent->rb_left) - parent->rb_left = new; - else - parent->rb_right = new; - } else { - root->rb_node = new; - } - if (victim->rb_left) - rb_set_parent(victim->rb_left, new); - if (victim->rb_right) - rb_set_parent(victim->rb_right, new); - - /* Copy the pointers/colour from the victim to the replacement */ - *new = *victim; -} - /** * Get the n-th node (in sort order) of the tree. *