Skip to content

Commit db85f61

Browse files
committed
Remove redundant optional argument
1 parent 405daf1 commit db85f61

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

compiler/syntax/src/jsx_v4.ml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ let transform_children_if_list ~mapper the_list =
9090
in
9191
transformChildren_ the_list []
9292

93-
let extract_children ?(remove_last_position_unit = false) ~loc
94-
props_and_children =
93+
let extract_children ~loc props_and_children =
9594
let rec allButLast_ lst acc =
9695
match lst with
9796
| [] -> []
@@ -111,10 +110,8 @@ let extract_children ?(remove_last_position_unit = false) ~loc
111110
| [], props ->
112111
(* no children provided? Place a placeholder list *)
113112
( Exp.construct {loc = Location.none; txt = Lident "[]"} None,
114-
if remove_last_position_unit then all_but_last props else props )
115-
| [(_, children_expr)], props ->
116-
( children_expr,
117-
if remove_last_position_unit then all_but_last props else props )
113+
all_but_last props )
114+
| [(_, children_expr)], props -> (children_expr, all_but_last props)
118115
| _ ->
119116
Jsx_common.raise_error ~loc
120117
"JSX: somehow there's more than one `children` label"
@@ -390,8 +387,7 @@ let make_props_record_type_sig ~core_type_of_attr ~external_
390387
let transform_uppercase_call3 ~config module_path mapper jsx_expr_loc
391388
call_expr_loc attrs call_arguments =
392389
let children, args_with_labels =
393-
extract_children ~remove_last_position_unit:true ~loc:jsx_expr_loc
394-
call_arguments
390+
extract_children ~loc:jsx_expr_loc call_arguments
395391
in
396392
let args_for_make = args_with_labels in
397393
let children_expr = transform_children_if_list_upper ~mapper children in
@@ -480,8 +476,7 @@ let transform_lowercase_call3 ~config mapper jsx_expr_loc call_expr_loc attrs
480476
in
481477

482478
let children, non_children_props =
483-
extract_children ~remove_last_position_unit:true ~loc:jsx_expr_loc
484-
call_arguments
479+
extract_children ~loc:jsx_expr_loc call_arguments
485480
in
486481
let args_for_make = non_children_props in
487482
let children_expr = transform_children_if_list_upper ~mapper children in

0 commit comments

Comments
 (0)