diff options
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/include/rtems/score/rbtreeimpl.h | 4 | ||||
-rw-r--r-- | cpukit/score/src/rbtreeiterate.c | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/cpukit/score/include/rtems/score/rbtreeimpl.h b/cpukit/score/include/rtems/score/rbtreeimpl.h index ed4cbd558a..607e7ebf84 100644 --- a/cpukit/score/include/rtems/score/rbtreeimpl.h +++ b/cpukit/score/include/rtems/score/rbtreeimpl.h @@ -37,7 +37,6 @@ extern "C" { * @brief Red-black tree visitor. * * @param[in] node The node. - * @param[in] dir The direction. * @param[in] visitor_arg The visitor argument. * * @retval true Stop the iteration. @@ -47,7 +46,6 @@ extern "C" { */ typedef bool (*RBTree_Visitor)( const RBTree_Node *node, - RBTree_Direction dir, void *visitor_arg ); @@ -55,13 +53,11 @@ typedef bool (*RBTree_Visitor)( * @brief Red-black tree iteration. * * @param[in] rbtree The red-black tree. - * @param[in] dir The direction. * @param[in] visitor The visitor. * @param[in] visitor_arg The visitor argument. */ void _RBTree_Iterate( const RBTree_Control *rbtree, - RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ); diff --git a/cpukit/score/src/rbtreeiterate.c b/cpukit/score/src/rbtreeiterate.c index 8b5da1ea9f..46a0e43fcd 100644 --- a/cpukit/score/src/rbtreeiterate.c +++ b/cpukit/score/src/rbtreeiterate.c @@ -28,18 +28,16 @@ void _RBTree_Iterate( const RBTree_Control *rbtree, - RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { - RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); - const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); + const RBTree_Node *current = _RBTree_Minimum( rbtree ); bool stop = false; while ( !stop && current != NULL ) { - stop = ( *visitor )( current, dir, visitor_arg ); + stop = ( *visitor )( current, visitor_arg ); - current = _RBTree_Next( current, dir ); + current = _RBTree_Successor( current ); } } |