From ef07decbacd17cd52f2e7d5d9770e57799ebcb62 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 12 Dec 2016 14:18:05 +0100 Subject: [PATCH] Revert "add `Array.append`" (already in stdlib Array) This reverts commit cdb4ba5dbc456885a008958228c3a04111ce41b1. --- src/core/CCArray.ml | 19 ------------------- src/core/CCArray.mli | 4 ---- 2 files changed, 23 deletions(-) diff --git a/src/core/CCArray.ml b/src/core/CCArray.ml index b58f2072..f881489e 100644 --- a/src/core/CCArray.ml +++ b/src/core/CCArray.ml @@ -490,25 +490,6 @@ let filter_map f a = let filter p a = filter_map (fun x -> if p x then Some x else None) a -let append a1 a2 = - let n1 = Array.length a1 in - let n2 = Array.length a2 in - if n1=0 then a2 - else if n2=0 then a1 - else ( - let res = Array.make (n1+n2) a1.(0) in - Array.blit a1 0 res 0 n1; - Array.blit a2 0 res n1 n2; - res - ) - -(*$= & ~printer:Q.Print.(array int) - [| 1;2;3;4 |] (append [|1;2|] [| 3;4 |]) - [| 1;2;3;4 |] (append [||] [| 1;2; 3;4 |]) - [| 1;2;3;4 |] (append [| 1;2; 3;4 |] [||]) - [||] (append [||] [||]) -*) - (* append [rev a] in front of [acc] *) let rec __rev_append_list a acc i = if i = Array.length a diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index a8298c6d..11be5ebd 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -187,10 +187,6 @@ val rev : 'a t -> 'a t (** Copy + reverse in place @since 0.20 *) -val append : 'a t -> 'a t -> 'a t -(** Append 2 arrays - @since NEXT_RELEASE *) - val filter : ('a -> bool) -> 'a t -> 'a t (** Filter elements out of the array. Only the elements satisfying the given predicate will be kept. *)