From e636fff1d49bfb260602b339ef7e3aa172ef0d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Bobot?= Date: Mon, 23 Mar 2020 23:31:09 +0100 Subject: [PATCH] Simplify sites_locations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove eval_without_empty Signed-off-by: François Bobot --- otherlibs/sites_locations/src/sites_locations.ml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/otherlibs/sites_locations/src/sites_locations.ml b/otherlibs/sites_locations/src/sites_locations.ml index e239fbd6f70..a1cb4ee826f 100644 --- a/otherlibs/sites_locations/src/sites_locations.ml +++ b/otherlibs/sites_locations/src/sites_locations.ml @@ -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) @@ -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