Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Fixed bug in node removal - the removed node was left in invalid state.
Browse files Browse the repository at this point in the history
This only caused problems if the node was later added back.
  • Loading branch information
dsrbecky committed Mar 28, 2012
1 parent 06440c4 commit 0fb7f12
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ static void DeleteNode(SharpTreeNode node)
Debug.Assert(node.listParent == null);
Debug.Assert(node.left == null);
Debug.Assert(node.right == null);
node.height = 1;
node.totalListLength = -1;
if (balancingNode != null)
RebalanceUntilRoot(balancingNode);
}
Expand Down

0 comments on commit 0fb7f12

Please sign in to comment.