mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-22 13:15:54 +08:00
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:
@@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user