Merge pull request #115 from shannah/issue_112_part2

Fixed issue with size not being updated in TreeMap upon removal of so…
This commit is contained in:
Alexey Andreev 2015-05-14 19:14:23 +03:00
commit be8e84349a

View File

@ -363,8 +363,8 @@ public class TTreeMap<K, V> extends TAbstractMap<K, V> implements TCloneable, TS
while (minDepth > 0) { while (minDepth > 0) {
TreeNode<K, V> node = pathToMin[--minDepth]; TreeNode<K, V> node = pathToMin[--minDepth];
node.left = right; node.left = right;
node.fix();
node = node.balance(); node = node.balance();
node.fix();
right = node; right = node;
} }
min.right = right; min.right = right;
@ -372,6 +372,7 @@ public class TTreeMap<K, V> extends TAbstractMap<K, V> implements TCloneable, TS
root = min; root = min;
root.fix(); root.fix();
} }
root.fix();
return root.balance(); return root.balance();
} }