From 851d8df9ad31c7e0c169ce49dba8d7e88a162a3d Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 22 Jan 2020 17:38:23 +0100 Subject: adjust to immutable/safe strings vs bytes split it was possible to fix to_CamelCase but it was actually unused... --- src/OCamlMakefile | 4 ++-- src/common.ml | 15 --------------- src/common.mli | 1 - 3 files changed, 2 insertions(+), 18 deletions(-) (limited to 'src') 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 -- cgit v1.2.1