Skip to content

Commit

Permalink
Further refactoring related to 636d055 suggested in review
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Sultanov <andrii.sultanov@cloud.com>
  • Loading branch information
last-genius committed Jul 1, 2024
1 parent 900564a commit 1003d6d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ocaml/xapi-idl/lib/xcp_service.ml
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,11 @@ let canonicalise x =
split_c ':' (Option.value (Sys.getenv_opt "PATH") ~default:"")
in
let first_hit =
List.fold_left
(fun found path ->
match found with
| Some _hit ->
found
| None ->
let possibility = Filename.concat path x in
if Sys.file_exists possibility then Some possibility else None
List.find_opt
(fun path ->
let possibility = Filename.concat path x in
Sys.file_exists possibility
)
None
(paths @ !extra_search_path)
in
match first_hit with
Expand Down

0 comments on commit 1003d6d

Please sign in to comment.