Commit 2294287c authored by POTTIER Francois's avatar POTTIER Francois

Change [Misc.ListExtras.equal] to return [false] if the lists have different lengths.

This conforms with the documentation of this function.
This function is currently unused anyway.
parent bb07fa6a
......@@ -402,7 +402,15 @@ let once x y =
result
module ListExtras = struct
let equal = List.for_all2
let rec equal (=) xs ys =
match xs, ys with
| [], [] ->
true
| x :: xs, y :: ys ->
x = y && equal (=) xs ys
| _ :: _, []
| [], _ :: _ ->
false
let hash hash xs =
Hashtbl.hash (List.map hash xs)
end
......
Markdown is supported
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