diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-01-22 17:38:23 +0100 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-01-25 18:57:12 +0100 |
commit | 851d8df9ad31c7e0c169ce49dba8d7e88a162a3d (patch) | |
tree | 0c4098227de9cd4b2814dc0ac39276d70d071dfe /src | |
parent | 216352f6bb07ddf629da2b71d9395c2e0a974b70 (diff) | |
download | perl_checker-851d8df9ad31c7e0c169ce49dba8d7e88a162a3d.tar perl_checker-851d8df9ad31c7e0c169ce49dba8d7e88a162a3d.tar.gz perl_checker-851d8df9ad31c7e0c169ce49dba8d7e88a162a3d.tar.bz2 perl_checker-851d8df9ad31c7e0c169ce49dba8d7e88a162a3d.tar.xz perl_checker-851d8df9ad31c7e0c169ce49dba8d7e88a162a3d.zip |
adjust to immutable/safe strings vs bytes split
it was possible to fix to_CamelCase but it was actually unused...
Diffstat (limited to 'src')
-rw-r--r-- | src/OCamlMakefile | 4 | ||||
-rw-r--r-- | src/common.ml | 15 | ||||
-rw-r--r-- | src/common.mli | 1 |
3 files changed, 2 insertions, 18 deletions
diff --git a/src/OCamlMakefile b/src/OCamlMakefile index ac2cd9c..cc71121 100644 --- a/src/OCamlMakefile +++ b/src/OCamlMakefile @@ -142,13 +142,13 @@ NCRESULT := $(addsuffix $(NCSUFFIX), $(RESULT)) TOPRESULT := $(addsuffix $(TOPSUFFIX), $(RESULT)) ifndef OCAMLC - OCAMLC := ocamlc -g -unsafe-string + OCAMLC := ocamlc -g endif export OCAMLC ifndef OCAMLOPT - OCAMLOPT := ocamlopt -g -unsafe-string + OCAMLOPT := ocamlopt -g endif export OCAMLOPT diff --git a/src/common.ml b/src/common.ml index dd2f6b1..04225f9 100644 --- a/src/common.ml +++ b/src/common.ml @@ -829,21 +829,6 @@ let words s = in collect (words_ [] 0) (split_at '\n' s) -let to_CamelCase s_ = - let l = ref [] in - let s = String.copy s_ in - for i = 1 to String.length s - 1 do - if is_uppercase (String.unsafe_get s i) && is_lowercase (String.unsafe_get s (i-1)) then ( - String.set s i (Char.lowercase (String.get s i)) ; - l := i :: !l - ) - done ; - if !l = [] then None else - let offset, s' = fold_left (fun (offset, s') i -> - i, s' ^ String.sub s offset (i-offset) ^ "_" - ) (0, "") (rev !l) in - Some (s' ^ String.sub s offset (String.length s - offset)) - let concat_symlink file link = if str_begins_with "..//" link then (* ..//foo => /foo *) skip_n_char 3 link diff --git a/src/common.mli b/src/common.mli index 86a13cd..9a30f9d 100644 --- a/src/common.mli +++ b/src/common.mli @@ -214,7 +214,6 @@ val readlines : in_channel -> string list val split_at : char -> string -> string list val split_at2 : char -> char -> string -> string list val words : string -> string list -val to_CamelCase : string -> string option val concat_symlink : string -> string -> string val expand_symlinks : string -> string val mtime : string -> float |