]> git.mdlowis.com Git - projs/libcds.git/commitdiff
move rightmost_descendent to info functions section
authora bellenir <a@bellenir.com>
Thu, 14 Aug 2014 07:22:21 +0000 (07:22 +0000)
committera bellenir <a@bellenir.com>
Thu, 14 Aug 2014 07:22:21 +0000 (07:22 +0000)
source/rbt/rbt.c

index 210384aa5571576a7bda2f6c8acb1452da155563..65375d9e06990fbc066dba5b4116d5d3715b5be9 100644 (file)
@@ -66,6 +66,10 @@ rbt_node_t* rbt_lookup(rbt_t* tree, void* value){
        return rbt_lookup_node(tree, tree->root, value);
 }
 
+static rbt_node_t* rightmost_descendent(rbt_node_t* node){
+       return (node->right) ? rightmost_descendent(node->right) : node;
+}
+
 
 /* ----------------------------------------- */
 /*    generally helpful tree manipulation    */
@@ -198,10 +202,6 @@ static void rbt_del_rebalance(rbt_t* tree, rbt_node_t* node){
        }
 }
 
-static rbt_node_t* rightmost_descendent(rbt_node_t* node){
-       return (node->right) ? rightmost_descendent(node->right) : node;
-}
-
 static void rbt_delete_node(rbt_t* tree, rbt_node_t* node){
        rbt_node_t* descendant = NULL;
        if(node->left && node->right){