From 1ccdea0d088223e9287147c8950f2e9547c801a2 Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 18 Jun 2018 17:49:38 +0200 Subject: [PATCH] Protocol Environment: replace try ... with --- .../tezos_protocol_environment_memory.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib_protocol_environment/tezos_protocol_environment_memory.ml b/src/lib_protocol_environment/tezos_protocol_environment_memory.ml index 57c74b46b..bca165395 100644 --- a/src/lib_protocol_environment/tezos_protocol_environment_memory.ml +++ b/src/lib_protocol_environment/tezos_protocol_environment_memory.ml @@ -24,8 +24,9 @@ module Context = struct match k, m with | [], m -> Some m | n :: k, Dir m -> begin - try raw_get (StringMap.find n m) k - with Not_found -> None + match StringMap.find_opt n m with + | Some res -> raw_get res k + | None -> None end | _ :: _, Key _ -> None