From 2df4e4ea84c6bc4bb11550e16e0cedf04debe871 Mon Sep 17 00:00:00 2001 From: Julien Signoles <julien.signoles@cea.fr> Date: Thu, 6 May 2021 16:14:51 +0200 Subject: [PATCH] remove custom version of Array.for_all --- src/libraries/datatype/structural_descr.ml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/libraries/datatype/structural_descr.ml b/src/libraries/datatype/structural_descr.ml index e0d8acc14cd..8b63e95066d 100644 --- a/src/libraries/datatype/structural_descr.ml +++ b/src/libraries/datatype/structural_descr.ml @@ -144,16 +144,8 @@ let poly f = function | Structure _ | T_pack _ as a -> try from_unmarshal (f (to_unmarshal a)) with Cannot_pack -> Unknown -(* would be better to put it in Extlib, but no access to this library here *) -let array_for_all f a = - try - Array.iter (fun x -> if not (f x) then raise Exit) a; - true - with Exit -> - false - let is_abstract_array a = - array_for_all (fun x -> x = Pack Unmarshal.Abstract) a + Array.for_all (fun x -> x = Pack Unmarshal.Abstract) a let poly_arr f a = if is_abstract_array a then Abstract @@ -185,7 +177,7 @@ let t_map_unchanged_compares = poly2 Unmarshal.t_map_unchangedcompares let t_hashtbl_unchanged_hashs = poly2 (Unmarshal.t_hashtbl_unchangedhashs) let t_sum a = - if array_for_all (is_abstract_array) a then Abstract + if Array.for_all (is_abstract_array) a then Abstract else Structure (Sum a) (* ********************************************************************** *) -- GitLab