aboutsummaryrefslogtreecommitdiff
path: root/clib
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-02-07 16:04:00 +0100
committerGaëtan Gilbert2019-02-07 16:04:00 +0100
commit787a2cd10d3b441e15adb2007ba94c7c8f107839 (patch)
tree0b2ba58d68ba71b66172bb2b70d5216aab2bdc16 /clib
parent99c1d7b0ae1beed66fe8dd6a06db84dc0c8322d8 (diff)
Remove some non tailrec List.map from CList implementations
Fix #9482
Diffstat (limited to 'clib')
-rw-r--r--clib/cList.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/clib/cList.ml b/clib/cList.ml
index aba3e46bd5..524945ef23 100644
--- a/clib/cList.ml
+++ b/clib/cList.ml
@@ -780,7 +780,7 @@ let share_tails l1 l2 =
(** {6 Association lists} *)
-let map_assoc f = List.map (fun (x,a) -> (x,f a))
+let map_assoc f = map (fun (x,a) -> (x,f a))
let rec assoc_f f a = function
| (x, e) :: xs -> if f a x then e else assoc_f f a xs
@@ -979,7 +979,7 @@ let rec duplicates cmp = function
and so on if there are more elements in the lists. *)
let cartesian op l1 l2 =
- map_append (fun x -> List.map (op x) l2) l1
+ map_append (fun x -> map (op x) l2) l1
(* [cartesians] is an n-ary cartesian product: it iterates
[cartesian] over a list of lists. *)
@@ -1006,7 +1006,7 @@ let cartesians_filter op init ll =
let rec factorize_left cmp = function
| (a,b) :: l ->
let al,l' = partition (fun (a',_) -> cmp a a') l in
- (a,(b :: List.map snd al)) :: factorize_left cmp l'
+ (a,(b :: map snd al)) :: factorize_left cmp l'
| [] -> []
module Smart =