git.annexia.org
/
goaljobs-goals.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
libguestfs: Enable debugging.
[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