Skip to content

Commit 6336e97

Browse files
committed
Use List.concat_map for list_to_url_query
1 parent 5c52e9e commit 6336e97

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

native/runtime/ppx_deriving_router_primitives.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ let option_of_url_query f k xs =
7272
| Ok v -> Ok (Some v)
7373
| Error err -> Error err))
7474

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

7977
let list_of_url_query f k xs =
8078
let rec loop acc k xs f =

0 commit comments

Comments
 (0)