summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--map.sml4
1 files changed, 2 insertions, 2 deletions
diff --git a/map.sml b/map.sml
index 7e05785..d8b3a37 100644
--- a/map.sml
+++ b/map.sml
@@ -38,11 +38,11 @@ struct
fun two (l : 'a map) (k : key) (v : 'a) (r : 'a map) : 'a map =
if height l <> height r then raise Fail "two: height mismatch" else
- Two (height l, l, k, v, r)
+ Two (height l + 1, l, k, v, r)
fun three (a : 'a map) (k1 : key) (v1 : 'a) (b : 'a map) (k2 : key) (v2 : 'a) (c : 'a map) : 'a map =
if not (height a = height b andalso height b = height c) then raise Fail "three: height mismatch" else
- Three (height a, a, k1, v1, b, k2, v2, c)
+ Three (height a + 1, a, k1, v1, b, k2, v2, c)
fun view (Tip : 'a map) : ('a map * key * 'a * 'a map) option = NONE
| view (Two (_, l, k, v, r)) = SOME (l, k, v, r)