From dd6de596fa61a372cd88d3f178e74b288bb4643c Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Wed, 6 Apr 2022 10:16:50 +0200
Subject: [PATCH] [ir2cabs] tiny refactoring (use List.fold_left instead of
 manual list unroll)

---
 convert.ml | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/convert.ml b/convert.ml
index efb13e6..8716e69 100644
--- a/convert.ml
+++ b/convert.ml
@@ -1853,12 +1853,10 @@ and make_assign_cap env cap =
 
 (* For a given lambda instance, initialize all overloaded call operators. *)
 and init_lambda_overloads env aux lam_name lam_type overloads closures =
-  match overloads with
-  | [] -> (env, aux)
-  | ovl::overloads ->
-    let (env, aux) =
-      init_lambda_single_overload env aux lam_name lam_type ovl closures in
-      init_lambda_overloads env aux lam_name lam_type overloads closures
+  let init_one (env, aux) ovl =
+    init_lambda_single_overload env aux lam_name lam_type ovl closures
+  in
+  List.fold_left init_one (env,aux) overloads
 
 (* For a given lambda instance, initialize one overloaded call operator.
    This is called once for a C++11 lambda and once or more for a C++14 generic
-- 
GitLab