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 <jdimino@janestreet.com>
This commit is contained in:
Jeremie Dimino 2018-05-28 17:01:00 +01:00 committed by Jérémie Dimino
parent 547998d6c6
commit d2b66279f6
1 changed files with 4 additions and 3 deletions

View File

@ -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 =