Simplify dump_config with Option.map

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
Rudi Grinberg 2018-07-01 17:32:05 +07:00
parent 7b12e12571
commit ba9335badf
1 changed files with 1 additions and 3 deletions

View File

@ -508,9 +508,7 @@ module Sub_system = struct
let dump_config lib =
Sub_system_name.Map.filter_map lib.sub_systems ~f:(fun (lazy inst) ->
let (Sub_system0.Instance.T ((module M), t)) = inst in
match M.to_sexp with
| None -> None
| Some f -> Some (f t))
Option.map ~f:(fun f -> f t) M.to_sexp)
end
(* +-----------------------------------------------------------------+