Skip to content

Commit

Permalink
Use List.concat_map for list_to_url_query
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed Jun 13, 2024
1 parent 5c52e9e commit 6336e97
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions native/runtime/ppx_deriving_router_primitives.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ let option_of_url_query f k xs =
| Ok v -> Ok (Some v)
| Error err -> Error err))

let list_to_url_query f k xs =
List.fold_left (fun acc x -> List.rev_append (f k x) acc) [] xs
|> List.rev
let list_to_url_query f k xs = List.concat_map (f k) xs

let list_of_url_query f k xs =
let rec loop acc k xs f =
Expand Down

0 comments on commit 6336e97

Please sign in to comment.