summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/rbtreeinsert.c
diff options
context:
space:
mode:
authorGedare Bloom <gedare@rtems.org>2012-03-29 20:41:34 -0400
committerGedare Bloom <gedare@rtems.org>2012-03-29 20:42:36 -0400
commit890358f4f7cb8bc3ac3dcbbe5805e8285c92444a (patch)
treeb939b17a28d00fe2a094bb2f64778da355f7bc40 /cpukit/score/src/rbtreeinsert.c
parentPC386 - Add files missed in previous commit (diff)
downloadrtems-890358f4f7cb8bc3ac3dcbbe5805e8285c92444a.tar.bz2
PR1994: RBTree Compare Result Change
Change the meaning of the compare result to simplify comparison of integer keys.
Diffstat (limited to 'cpukit/score/src/rbtreeinsert.c')
-rw-r--r--cpukit/score/src/rbtreeinsert.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cpukit/score/src/rbtreeinsert.c b/cpukit/score/src/rbtreeinsert.c
index 798bd87015..3ea6b354b4 100644
--- a/cpukit/score/src/rbtreeinsert.c
+++ b/cpukit/score/src/rbtreeinsert.c
@@ -97,9 +97,9 @@ RBTree_Node *_RBTree_Insert_unprotected(
/* typical binary search tree insert, descend tree to leaf and insert */
while (iter_node) {
compare_result = the_rbtree->compare_function(the_node, iter_node);
- if ( the_rbtree->is_unique && !compare_result )
+ if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) )
return iter_node;
- RBTree_Direction dir = (compare_result != -1);
+ RBTree_Direction dir = !_RBTree_Is_lesser( compare_result );
if (!iter_node->child[dir]) {
the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL;
the_node->color = RBT_RED;