Skip to content

Commit

Permalink
Remove unneeded match
Browse files Browse the repository at this point in the history
  • Loading branch information
drewolson committed Dec 1, 2023
1 parent 30896c7 commit 2cdc4e4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/year2023/day01.ml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ let re_b =
|> Re.compile
;;

let replace_word m =
match Map.find mapping m with
| Some i -> i
| _ -> m
;;
let replace_word m = Map.find mapping m |> Option.value ~default:m

let to_digit' line =
let a = Re.Group.get (Re.exec re_f line) 0 |> replace_word in
Expand Down

0 comments on commit 2cdc4e4

Please sign in to comment.