From faf3bbc06106de98189f1c1673bd57e78351dc7e Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Wed, 21 Aug 2019 07:34:39 -0700 Subject: [PATCH] Fix unpack_closure --- src/compiler/compiler_environment.ml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/compiler/compiler_environment.ml b/src/compiler/compiler_environment.ml index f0fed96c4..7ab0ea76b 100644 --- a/src/compiler/compiler_environment.ml +++ b/src/compiler/compiler_environment.ml @@ -73,15 +73,5 @@ let pack_closure : environment -> selector -> michelson result = fun e lst -> ok code let unpack_closure : environment -> michelson result = fun e -> - let lst = - match e with - | [] -> [] - | _ :: tl -> [ - i_unpair ; - dip @@ seq @@ List.map (Function.constant i_unpair) tl ; - ] - in - - let code = seq lst in - - ok code + let aux = fun code _ -> seq [ i_unpair ; dip code ] in + ok (List.fold_right' aux (seq []) e)