From 9eaf564d52a4c09da797d5080460f06d3e296191 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 31 Mar 2016 13:31:24 +0200 Subject: score: Add and use _RBTree_Insert_inline() --- cpukit/posix/include/rtems/posix/keyimpl.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'cpukit/posix') diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h index 7715fdfcdc..7095a1669d 100644 --- a/cpukit/posix/include/rtems/posix/keyimpl.h +++ b/cpukit/posix/include/rtems/posix/keyimpl.h @@ -158,29 +158,11 @@ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_insert( Thread_Control *the_thread ) { - RBTree_Node **link; - RBTree_Node *parent; - - link = _RBTree_Root_reference( &the_thread->Keys.Key_value_pairs ); - parent = NULL; - - while ( *link != NULL ) { - POSIX_Keys_Key_value_pair *parent_key_value_pair; - - parent = *link; - parent_key_value_pair = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( parent ); - - if ( key < parent_key_value_pair->key ) { - link = _RBTree_Left_reference( parent ); - } else { - link = _RBTree_Right_reference( parent ); - } - } - - _RBTree_Add_child( &key_value_pair->Lookup_node, parent, link ); - _RBTree_Insert_color( + _RBTree_Insert_inline( &the_thread->Keys.Key_value_pairs, - &key_value_pair->Lookup_node + &key_value_pair->Lookup_node, + &key, + _POSIX_Keys_Key_value_less ); } -- cgit v1.2.3