From 88dcc77ca7813ecdde58b5d0caf41be5141704be Mon Sep 17 00:00:00 2001 From: Henrique Gemignani Passos Lima Date: Wed, 26 Oct 2022 19:16:41 +0300 Subject: [PATCH] Match rbtree_rebalance. Thanks encounter --- src/Kyoto/rstl/rstl_map.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Kyoto/rstl/rstl_map.cpp b/src/Kyoto/rstl/rstl_map.cpp index d6228ca5..fe6181d6 100644 --- a/src/Kyoto/rstl/rstl_map.cpp +++ b/src/Kyoto/rstl/rstl_map.cpp @@ -85,9 +85,9 @@ void rbtree_rebalance(void* header_void, void* node_void) { } else { if (node == node->mParent->mRight) { - rbtree_rotate_left(header, node->mParent); + node = node->mParent; + rbtree_rotate_left(header, node); } - // node = node->mParent; node->mParent->mColor = kNC_Red; node->mParent->mParent->mColor = kNC_Black; rbtree_rotate_right(header, node->mParent->mParent); @@ -100,9 +100,9 @@ void rbtree_rebalance(void* header_void, void* node_void) { } else { if (node == node->mParent->mLeft) { - rbtree_rotate_right(header, node->mParent); + node = node->mParent; + rbtree_rotate_right(header, node); } - // node = node->mParent; node->mParent->mColor = kNC_Red; node->mParent->mParent->mColor = kNC_Black; rbtree_rotate_left(header, node->mParent->mParent);