From 710266e09cffb6083ff7a381206bee43f154811b Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Sun, 4 Feb 2018 17:34:30 +0000 Subject: [PATCH 1/2] Don't reverse twice in CCList.repeat --- src/core/CCList.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/CCList.ml b/src/core/CCList.ml index 3da6407f..acbcc57b 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -1253,11 +1253,15 @@ let replicate i x = else aux (x::acc) (i-1) in aux [] i + +(*$T + repeat 2 [1;2;3] = [1;2;3;1;2;3] +*) + let repeat i l = - let l' = List.rev l in let rec aux acc i = if i = 0 then List.rev acc - else aux (List.rev_append l' acc) (i-1) + else aux (List.rev_append l acc) (i-1) in aux [] i module Assoc = struct From 60596e54086c9d9c9c91facfa0606b4703329f0a Mon Sep 17 00:00:00 2001 From: Dave Aitken Date: Sun, 4 Feb 2018 17:56:07 +0000 Subject: [PATCH 2/2] Update authors list --- AUTHORS.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.adoc b/AUTHORS.adoc index 5d6d131c..839603bd 100644 --- a/AUTHORS.adoc +++ b/AUTHORS.adoc @@ -25,3 +25,4 @@ - Fabian Hemmer (copy) - Maciej Woś (@lostman) - Orbifx (Stavros Polymenis) +- Dave Aitken (@actionshrimp) \ No newline at end of file