[rtems commit] posix: Avoid _RBTree_Next()

Sebastian Huber sebh at rtems.org
Mon Aug 31 08:41:20 UTC 2015


Module:    rtems
Branch:    master
Commit:    1f242285df6ed7f6083f6d1538deccff1f3ceb62
Changeset: http://git.rtems.org/rtems/commit/?id=1f242285df6ed7f6083f6d1538deccff1f3ceb62

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Aug 21 05:25:37 2015 +0200

posix: Avoid _RBTree_Next()

---

 cpukit/posix/src/keyfreememory.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c
index 8ae7fd0..0e2c517 100644
--- a/cpukit/posix/src/keyfreememory.c
+++ b/cpukit/posix/src/keyfreememory.c
@@ -37,11 +37,11 @@ void _POSIX_Keys_Free_memory(
   /**
    * find the smallest thread_id node in the rbtree.
    */
-  next = _RBTree_Next( iter, RBT_LEFT );
+  next = _RBTree_Predecessor( iter );
   p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( next );
   while ( next != NULL && p->key == key_id) {
     iter = next;
-    next = _RBTree_Next( iter, RBT_LEFT );
+    next = _RBTree_Predecessor( iter );
     p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( next );
   }
 
@@ -50,7 +50,7 @@ void _POSIX_Keys_Free_memory(
    */
   p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( iter );
   while ( iter != NULL && p->key == key_id ) {
-    next = _RBTree_Next( iter, RBT_RIGHT );
+    next = _RBTree_Successor( iter );
 
     _POSIX_Keys_Free_key_value_pair( p );
 




More information about the vc mailing list