Skip to content
Snippets Groups Projects
Commit 618c6118 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[lib] fixes wrong cmp for lists of different length in Extlib.list_compare

the shortest list is _smaller_ than the longest one.
parent 052cd89d
No related branches found
No related tags found
No related merge requests found
......@@ -127,8 +127,8 @@ let rec list_compare cmp_elt l1 l2 =
else
match l1, l2 with
| [], [] -> assert false (* included in l1 == l2 above *)
| [], _ :: _ -> 1
| _ :: _, [] -> -1
| [], _ :: _ -> -1
| _ :: _, [] -> 1
| v1::r1, v2::r2 ->
let c = cmp_elt v1 v2 in
if c = 0 then list_compare cmp_elt r1 r2 else c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment