Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/fable-library-dart/Map.fs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ module MapTree =
else // rotate left
mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right
| _ -> failwith "internal error: Map.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? MapTreeNode<'Key, 'Value> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-dart/Set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ module SetTree =
else // rotate left
mk (mk t1 v t2'.Left) t2'.Key t2'.Right
| _ -> failwith "internal error: Set.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? SetTreeNode<'T> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-py/fable_library/Map.fs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ module MapTree =
else // rotate left
mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right
| _ -> failwith "internal error: Map.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? MapTreeNode<'Key, 'Value> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-py/fable_library/Set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ module SetTree =
else // rotate left
mk (mk t1 v t2'.Left) t2'.Key t2'.Right
| _ -> failwith "internal error: Set.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? SetTreeNode<'T> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-rust/src/Map.fs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ let rebalance t1 (k: 'K) (v: 'V) t2 : Map<'K, 'V> =
mk (mk t1 k v t2l.Left) t2l.Key t2l.Value (mk t2l.Right t2'.Key t2'.Value t2'.Right)
else // rotate left
mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
let t1' = (getRoot t1).Value
// one of the nodes must have height > height t2 + 1
if height t1'.Right > t2h + 1 then
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-rust/src/Set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ let rebalance (t1: Set<'T>) v (t2: Set<'T>) =
mk (mk t1 v t2l.Left) t2l.Key (mk t2l.Right t2'.Key t2'.Right)
else // rotate left
mk (mk t1 v t2'.Left) t2'.Key t2'.Right
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
let t1' = (getRoot t1).Value
// one of the nodes must have height > height t2 + 1
if height t1'.Right > t2h + 1 then
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-ts/Map.fs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ module MapTree =
else // rotate left
mk (mk t1 k v t2'.Left) t2'.Key t2'.Value t2'.Right
| _ -> failwith "internal error: Map.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? MapTreeNode<'Key, 'Value> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
3 changes: 2 additions & 1 deletion src/fable-library-ts/Set.fs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ module SetTree =
else // rotate left
mk (mk t1 v t2'.Left) t2'.Key t2'.Right
| _ -> failwith "internal error: Set.rebalance"
else if t1h > t2h + tolerance then // left is heavier than right
// left is heavier than right
else if t1h > t2h + tolerance then
match t1.Value with
| :? SetTreeNode<'T> as t1' ->
// one of the nodes must have height > height t2 + 1
Expand Down
Loading