Add libguestfs upstream build rules.
[goaljobs-goals.git] / utils.ml
1 open Printf
2
3 open Goaljobs
4 open Config
5
6 (* From supermin *)
7 let rec uniq ?(cmp = Pervasives.compare) = function
8   | [] -> []
9   | [x] -> [x]
10   | x :: y :: xs when cmp x y = 0 ->
11       uniq ~cmp (x :: xs)
12   | x :: y :: xs ->
13       x :: uniq ~cmp (y :: xs)
14
15 let sort_uniq ?(cmp = Pervasives.compare) xs =
16   let xs = List.sort cmp xs in
17   let xs = uniq ~cmp xs in
18   xs