From a9c249ea86511b8cb382855bf32f8c3140ec4f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Tue, 19 Nov 2024 16:26:02 +0100 Subject: [PATCH] Use Map.fold over List.fold_left ... (Map.bindings _) --- mirage/unikernel.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mirage/unikernel.ml b/mirage/unikernel.ml index b5ad494..3d62810 100644 --- a/mirage/unikernel.ml +++ b/mirage/unikernel.ml @@ -158,7 +158,8 @@ module Make let url_csums, errs = Opam_file.extract_urls path data in List.iter (fun (`Msg msg) -> add_parse_error path msg) errs; let upstream hm = - List.fold_left (fun set (hash, hash_value) -> + HM.fold + (fun hash hash_value set -> List.fold_left (fun set cache_url -> let url = cache_url ^ "/" ^ Archive_checksum.Hash.to_string hash ^ @@ -166,7 +167,7 @@ module Make in SSet.add url set) set (K.upstream_caches ())) - SSet.empty (HM.bindings hm) + hm SSet.empty in List.fold_left (fun acc (url, csums, mirrors) -> if HM.cardinal csums = 0 then