Skip to content

Commit

Permalink
Use Option.map_default instead of match
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Schwarz <[email protected]>
  • Loading branch information
mrstanb and michael-schwarz authored Oct 6, 2023
1 parent b9c2134 commit 625e90b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/analyses/base.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2133,10 +2133,7 @@ struct
let desc = LF.find f in
let memory_copying dst src n =
let dest_size = get_size_of_ptr_target ctx dst in
let n_intdom = match n with
| Some exp -> ctx.ask (Queries.EvalInt exp)
| None -> `Bot
in
let n_intdom = Option.map_default (fun exp -> ctx.ask (Queries.EvalInt exp)) `Bot n in
let dest_size_equal_n =
match dest_size, n_intdom with
| `Lifted ds, `Lifted n ->
Expand Down

0 comments on commit 625e90b

Please sign in to comment.