Skip to content

Commit 4ea470f

Browse files
committed
Fix, add since tag.
1 parent 25105b2 commit 4ea470f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

stdlib/map.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ module Make(Ord: OrderedType) = struct
269269
Empty ->
270270
begin match f None with
271271
| None -> Empty
272-
| Some data -> Node(Empty, x, data, Empty, 1)
272+
| Some data -> Node{l=Empty; v=x; d=data; r=Empty; h=1}
273273
end
274-
| Node(l, v, d, r, h) as m ->
274+
| Node {l; v; d; r; h} as m ->
275275
let c = Ord.compare x v in
276276
if c = 0 then begin
277277
match f (Some d) with
278278
| None -> merge l r
279279
| Some data ->
280-
if d == data then m else Node(l, x, data, r, h)
280+
if d == data then m else Node{l; v=x; d=data; r; h}
281281
end else if c < 0 then
282282
let ll = update x f l in
283283
if l == ll then m else bal ll v d r

stdlib/map.mli

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ module type S =
9595
is associated to [z] in the resulting map. If [x] was already
9696
bound in [m] to a value that is physically equal to [z], [m]
9797
is returned unchanged (the result of the function is then
98-
physically equal to [m]). *)
98+
physically equal to [m]).
99+
@since 4.06.0
100+
*)
99101

100102
val singleton: key -> 'a -> 'a t
101103
(** [singleton x y] returns the one-element map that contains a binding [y]

0 commit comments

Comments
 (0)