Skip to content

Commit 48a2416

Browse files
committed
refactor: check for parameter once in install rules
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 0dd1910 commit 48a2416

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/dune_rules/install_rules.ml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,17 +350,20 @@ end = struct
350350
Path.Build.relative dir (base ^ Foreign_language.header_extension)
351351
|> make_entry ~loc Lib)
352352
in
353-
let if_ cond f = if cond then f else [] in
354353
List.rev_concat
355354
[ sources
356355
; melange_runtime_entries
357356
; List.rev_map module_files ~f:(fun (sub_dir, file) -> make_entry ?sub_dir Lib file)
358-
; if_ (not is_parameter)
359-
@@ List.rev_map lib_files ~f:(fun (section, file) -> make_entry section file)
360-
; if_ (not is_parameter) @@ List.rev_map execs ~f:(make_entry Libexec)
361-
; if_ (not is_parameter) @@ dll_files
362-
; if_ (not is_parameter) @@ install_c_headers
363-
; if_ (not is_parameter) @@ public_headers
357+
; (match is_parameter with
358+
| true -> []
359+
| false ->
360+
List.rev_concat
361+
[ List.rev_map lib_files ~f:(fun (section, file) -> make_entry section file)
362+
; List.rev_map execs ~f:(make_entry Libexec)
363+
; dll_files
364+
; install_c_headers
365+
; public_headers
366+
])
364367
]
365368
;;
366369

0 commit comments

Comments
 (0)