mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
stricter warnings; remove dead code
This commit is contained in:
parent
3975eb9862
commit
77ff1ee6a5
3 changed files with 1 additions and 24 deletions
|
|
@ -3,7 +3,6 @@ let width_ = 8
|
|||
(* Helper functions *)
|
||||
let[@inline] get_ b i = Char.code (Bytes.get b i)
|
||||
let[@inline] unsafe_get_ b i = Char.code (Bytes.unsafe_get b i)
|
||||
let[@inline] set_ b i v = Bytes.set b i (Char.unsafe_chr v)
|
||||
let[@inline] unsafe_set_ b i v = Bytes.unsafe_set b i (Char.unsafe_chr v)
|
||||
let[@inline] mod_ n = n land 0b111
|
||||
let[@inline] div_ n = n lsr 3
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ module A = struct
|
|||
let length = Array.length
|
||||
let iteri = Array.iteri
|
||||
let iter = Array.iter
|
||||
let fold = Array.fold_left
|
||||
let map = Array.map
|
||||
|
||||
let iteri_rev f a =
|
||||
|
|
@ -50,7 +49,6 @@ module A = struct
|
|||
f i a.(i)
|
||||
done
|
||||
|
||||
let create () = [||]
|
||||
let empty = [||]
|
||||
let is_empty a = length a = 0
|
||||
let return x = [| x |]
|
||||
|
|
@ -72,21 +70,6 @@ module A = struct
|
|||
if n = 0 then invalid_arg "A.pop";
|
||||
Array.sub a 0 (n - 1)
|
||||
|
||||
let append a b =
|
||||
let n_a = length a in
|
||||
let n_b = length b in
|
||||
if n_a + n_b > max_length then invalid_arg "A.append";
|
||||
if n_a = 0 then
|
||||
b
|
||||
else if n_b = 0 then
|
||||
a
|
||||
else (
|
||||
let arr = Array.make (n_a + n_b) a.(0) in
|
||||
Array.blit a 0 arr 0 n_a;
|
||||
Array.blit b 0 arr n_a n_b;
|
||||
arr
|
||||
)
|
||||
|
||||
let set ~mut a i x =
|
||||
if i < 0 || i > length a || i >= max_length then invalid_arg "A.set";
|
||||
if i = length a then (
|
||||
|
|
@ -306,11 +289,6 @@ let to_gen m =
|
|||
|
||||
let choose m = to_gen m ()
|
||||
|
||||
let choose_exn m =
|
||||
match choose m with
|
||||
| None -> raise Not_found
|
||||
| Some (k, v) -> k, v
|
||||
|
||||
let pp ppv out m =
|
||||
let first = ref true in
|
||||
iter m ~f:(fun v ->
|
||||
|
|
|
|||
2
src/dune
2
src/dune
|
|
@ -1,6 +1,6 @@
|
|||
(env
|
||||
(_
|
||||
(flags :standard -warn-error -a+8 -w -32-70 -w +a-4-32-40-42-44-70
|
||||
(flags :standard -warn-error -a+8 -w -32-70 -w +a-4-40-42-44-70
|
||||
-color always -safe-string -strict-sequence)
|
||||
(ocamlopt_flags :standard -O3 -unbox-closures -unbox-closures-factor 20
|
||||
-inline 100)))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue