Update the node balance when deleting a duplicate in the AVL tree.
authorcoderain <coderain@sdf.org>
Tue, 17 Jul 2018 23:08:23 +0000 (01:08 +0200)
committercoderain <coderain@sdf.org>
Tue, 17 Jul 2018 23:08:23 +0000 (01:08 +0200)
sdk/avltree.h

index 1c56f5e0a57e4c2d334716af5b1b28859939e258..e389fba7dc38642639a60b55cb03ea68eeb58870 100644 (file)
@@ -276,6 +276,7 @@ static void avl_tree_remove(avl_tree_t *tree, avl_node_t *node)
         node->next_equal->left = node->left;
         node->next_equal->right = node->right;
         node->next_equal->prev_equal = NULL;
+        node->next_equal->balance = node->balance;
 
         if (node->parent)
         {