Skip to content

Commit

Permalink
use match to avoid building string in the happy case
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Oct 3, 2023
1 parent 627c3c1 commit deda9f9
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/base/checked_runner.ml
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,15 @@ struct
let old = Run_state.as_prover s in
Run_state.set_as_prover s true ;
let value =
As_prover.Provider.run p (get_value s) (Run_state.handler s)
|> Option.value_exn
~message:
( "Unhandled request: "
^ Core_kernel.String.concat ~sep:"\n" (Run_state.stack s) )
match
As_prover.Provider.run p (get_value s) (Run_state.handler s)
with
| Some x ->
x
| None ->
failwith
( "Unhandled request: "
^ Core_kernel.String.concat ~sep:"\n" (Run_state.stack s) )
in
Run_state.set_as_prover s old ;
let var =
Expand Down

0 comments on commit deda9f9

Please sign in to comment.