Changeset b9877ee in rtems for cpukit/sapi


Ignore:
Timestamp:
Aug 21, 2015, 3:55:04 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ddb6a49b
Parents:
2d48456
git-author:
Sebastian Huber <sebastian.huber@…> (08/21/15 03:55:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/31/15 07:59:42)
Message:

rbtree: Delete _RBTree_Get()

This function has no internal use case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/rtems/rbtree.h

    r2d48456 rb9877ee  
    297297
    298298/**
    299  * @brief Obtain the min node on a rbtree.
    300  *
    301  * This function removes the min node from @a the_rbtree and returns
    302  * a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
    303  */
    304 
     299 * @brief Gets a node with the minimum key value from the red-black tree.
     300 *
     301 * This function extracts a node with the minimum key value from
     302 * tree and returns a pointer to that node if it exists.  In case multiple
     303 * nodes with a minimum key value exist, then they are extracted in FIFO order.
     304 *
     305 * @param[in] the_rbtree The red-black tree control.
     306 *
     307 * @retval NULL The tree is empty.
     308 * @retval node A node with the minimal key value on the tree.
     309 */
    305310RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_min(
    306311  rtems_rbtree_control *the_rbtree
    307312)
    308313{
    309   return _RBTree_Get( the_rbtree, RBT_LEFT );
    310 }
    311 
    312 /**
    313  * @brief Obtain the max node on a rbtree.
    314  *
    315  * This function removes the max node from @a the_rbtree and returns
    316  * a pointer to that node.  If @a the_rbtree is empty, then NULL is returned.
    317  */
    318 
     314  rtems_rbtree_node *the_node = rtems_rbtree_min( the_rbtree );
     315
     316  if ( the_node != NULL ) {
     317    rtems_rbtree_extract( the_rbtree, the_node );
     318  }
     319
     320  return the_node;
     321}
     322
     323/**
     324 * @brief Gets a node with the maximal key value from the red-black tree.
     325 *
     326 * This function extracts a node with the maximum key value from tree and
     327 * returns a pointer to that node if it exists.  In case multiple nodes with a
     328 * maximum key value exist, then they are extracted in LIFO order.
     329 *
     330 * @param[in] the_rbtree The red-black tree control.
     331 *
     332 * @retval NULL The tree is empty.
     333 * @retval node A node with the maximal key value on the tree.
     334 */
    319335RTEMS_INLINE_ROUTINE rtems_rbtree_node *rtems_rbtree_get_max(
    320336  rtems_rbtree_control *the_rbtree
    321337)
    322338{
    323   return _RBTree_Get( the_rbtree, RBT_RIGHT );
     339  rtems_rbtree_node *the_node = rtems_rbtree_max( the_rbtree );
     340
     341  if ( the_node != NULL ) {
     342    rtems_rbtree_extract( the_rbtree, the_node );
     343  }
     344
     345  return the_node;
    324346}
    325347
Note: See TracChangeset for help on using the changeset viewer.