From d2b66279f6ccae29091bacf6ca0e5b257a925552 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Mon, 28 May 2018 17:01:00 +0100 Subject: [PATCH] Use Sys.{win32,cygwin} rather than Sys.os_type The former functions are optimized away while the latter isn't. Signed-off-by: Jeremie Dimino --- src/stdune/path.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/stdune/path.ml b/src/stdune/path.ml index df738579..cdb1dae6 100644 --- a/src/stdune/path.ml +++ b/src/stdune/path.ml @@ -1,7 +1,8 @@ let is_dir_sep = - match Sys.os_type with - | "Win32" | "Cygwin" -> fun c -> c = '/' || c = '\\' || c = ':' - | _ -> fun c -> c = '/' + if Sys.win32 || Sys.cygwin then + fun c -> c = '/' || c = '\\' || c = ':' + else + fun c -> c = '/' let explode_path = let rec start acc path i =