rbtree: Simplify insert and extract

Simplify _RBTree_Insert() and _RBTree_Extract().  Remove more
superfluous NULL pointer checks.  Change _RBTree_Is_root() to use only
the node.  Add parent parameter to _RBTree_Sibling().  Delete
_RBTree_Grandparent() and _RBTree_Parent_sibling().
This commit is contained in:
Sebastian Huber
2014-08-07 15:59:29 +02:00
parent 4752550f80
commit 993f5acd25
6 changed files with 86 additions and 99 deletions
+3 -9
View File
@@ -195,9 +195,7 @@ RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_right(
}
/**
* @brief Return pointer to the parent child node from this node.
*
* This function returns a pointer to the parent node of @a the_node.
* @copydoc _RBTree_Parent()
*/
RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_parent(
const rtems_rbtree_node *the_node
@@ -248,17 +246,13 @@ RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_max(
}
/**
* @brief Is this node the RBTree root.
*
* This function returns true if @a the_node is the root of @a the_rbtree and
* false otherwise.
* @copydoc _RBTree_Is_root()
*/
RTEMS_INLINE_ROUTINE bool rtems_rbtree_is_root(
const rtems_rbtree_control *the_rbtree,
const rtems_rbtree_node *the_node
)
{
return _RBTree_Is_root( the_rbtree, the_node );
return _RBTree_Is_root( the_node );
}
/**