Merge a map/filter Fun.id with filter_map
This commit is contained in:
@@ -35,8 +35,8 @@ let is_valid_target tgt nums ops =
|
|||||||
| [] -> List.exists (( = ) 0) tgts
|
| [] -> List.exists (( = ) 0) tgts
|
||||||
| h :: t ->
|
| h :: t ->
|
||||||
impl
|
impl
|
||||||
(List.map (fun tgt -> List.map (fun op -> op tgt h) ops) tgts
|
(List.map (fun tgt -> List.filter_map (fun op -> op tgt h) ops) tgts
|
||||||
|> List.concat |> List.filter_map Fun.id)
|
|> List.concat)
|
||||||
t
|
t
|
||||||
in
|
in
|
||||||
impl [ tgt ] nums
|
impl [ tgt ] nums
|
||||||
|
Reference in New Issue
Block a user