@@ -724,12 +724,12 @@ namespace Internal.Utilities.Collections.Tagged
724724#endif
725725| MapNode(_,_,_,_, h) -> h
726726
727- let isEmpty m =
727+ letinline isEmpty m =
728728match mwith
729729| MapEmpty-> true
730730| _ -> false
731731
732- let mk l k v r =
732+ letinline mk l k v r =
733733#if ONE
734734match l, rwith
735735| MapEmpty, MapEmpty-> MapOne( k, v)
@@ -741,8 +741,9 @@ namespace Internal.Utilities.Collections.Tagged
741741 MapNode( k, v, l, r, m+ 1 )
742742
743743let rebalance t1 k v t2 =
744- let t1h = height t1
745- if height t2> t1h+ 2 then // right is heavier than left
744+ let t1h = height t1
745+ let t2h = height t2
746+ if t2h> t1h+ 2 then // right is heavier than left
746747match t2with
747748| MapNode( t2k, t2v, t2l, t2r,_) ->
748749// one of the nodes must have height > height t1 + 1
@@ -755,8 +756,7 @@ namespace Internal.Utilities.Collections.Tagged
755756 mk( mk t1 k v t2l) t2k t2v t2r
756757| _ -> failwith" rebalance"
757758else
758- let t2h = height t2
759- if t1h> t2h+ 2 then // left is heavier than right
759+ if t1h> t2h+ 2 then // left is heavier than right
760760match t1with
761761| MapNode( t1k, t1v, t1l, t1r,_) ->
762762// one of the nodes must have height > height t2 + 1
@@ -1097,7 +1097,8 @@ namespace Internal.Utilities.Collections.Tagged
10971097[<Sealed>]
10981098type internal Map < 'Key , 'T , 'ComparerTag > when 'ComparerTag :> IComparer < 'Key >( comparer :IComparer < 'Key >, tree :MapTree < 'Key , 'T >) =
10991099
1100- static let refresh ( m : Map < _ , _ , 'ComparerTag >) t = Map<_,_, 'ComparerTag>( comparer= m.Comparer, tree= t)
1100+ static let refresh ( m : Map < _ , _ , 'ComparerTag >) t =
1101+ Map<_,_, 'ComparerTag>( comparer= m.Comparer, tree= t)
11011102
11021103member s.Tree = tree
11031104member s.Comparer : IComparer < 'Key > = comparer