fix(string): compat 4.02

This commit is contained in:
Simon Cruanes 2018-03-28 20:09:05 -05:00
parent 55e92b4629
commit 89fc7f9c77

View file

@ -696,7 +696,7 @@ let prefix ~pre s =
else ( else (
let rec check i = let rec check i =
if i=len then true if i=len then true
else if not (Char.equal (String.unsafe_get s i) (String.unsafe_get pre i)) then false else if Pervasives.(<>) (String.unsafe_get s i) (String.unsafe_get pre i) then false
else check (i+1) else check (i+1)
in in
check 0 check 0
@ -719,7 +719,7 @@ let suffix ~suf s =
let off = String.length s - len in let off = String.length s - len in
let rec check i = let rec check i =
if i=len then true if i=len then true
else if not (Char.equal (String.unsafe_get s (off+i)) (String.unsafe_get suf i)) then false else if Pervasives.(<>) (String.unsafe_get s (off+i)) (String.unsafe_get suf i) then false
else check (i+1) else check (i+1)
in in
check 0 check 0