Commit 1200a8c1 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

Removed [MySet.for_every], which allowed finding a range of keys

in a binary search tree.
parent ff8c47d7
......@@ -86,22 +86,4 @@ module Make (Ord: Map.OrderedType) =
Empty -> ()
| Node(l, v, r, _) -> iter f l; f v; iter f r
let rec for_every cmp t f =
match t with
Empty -> ()
| Node(l, v, r, _) ->
let c = cmp v in
if c = 0 then begin
(* The desired range includes [v] and may include parts of [l] and [r]. *)
for_every cmp l f;
f v;
for_every cmp r f
else if c < 0 then
(* The desired range is below [v], but may include parts of [l]. *)
for_every cmp l f
(* The desired range is above [v], but may include parts of [l]. *)
for_every cmp r f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment