diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java index 9263831d3..7ed9729e8 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/util/TTreeMap.java @@ -363,8 +363,8 @@ public class TTreeMap extends TAbstractMap implements TCloneable, TS while (minDepth > 0) { TreeNode node = pathToMin[--minDepth]; node.left = right; - node.fix(); node = node.balance(); + node.fix(); right = node; } min.right = right; @@ -372,6 +372,7 @@ public class TTreeMap extends TAbstractMap implements TCloneable, TS root = min; root.fix(); } + root.fix(); return root.balance(); }