Skip to content

Commit

Permalink
Simplify sites_locations
Browse files Browse the repository at this point in the history
     * remove eval_without_empty

Signed-off-by: François Bobot <[email protected]>
  • Loading branch information
bobot committed Mar 31, 2020
1 parent 74b8e1e commit e636fff
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions otherlibs/sites_locations/src/sites_locations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ module Private_ = struct
None
[@@inline never]

let eval_without_empty encoded =
match eval encoded with
| None | Some "" -> None
| Some _ as x -> x

let get_dir ~package ~section =
Hashtbl.find_all dirs (package,section)

Expand All @@ -99,13 +94,13 @@ module Private_ = struct
Sys.getenv_opt "DUNE_SOURCEROOT"

let path_sep = if Sys.win32 then ";" else ":"
let ocamlpath local =
let ocamlpath installlib =
let env = match Sys.getenv_opt "OCAMLPATH" with
| None -> []
| Some x -> [x]
in
let env = match eval_without_empty local with
| None -> env
let env = match eval installlib with
| None | Some "" -> env
| Some x -> x::env
in
String.concat path_sep env
Expand Down

0 comments on commit e636fff

Please sign in to comment.