[Libguestfs] [PATCH v3 21/22] generator: Replace use of Str.split with String.nsplit.

Richard W.M. Jones rjones at redhat.com
Fri Sep 22 07:36:22 UTC 2017


Faster and equivalent.
---
 generator/actions.ml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generator/actions.ml b/generator/actions.ml
index 914c123b1..e052284d0 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -98,7 +98,7 @@ let non_daemon_functions, daemon_functions =
     List.fold_left (
       fun a b ->
         a ^ String.uppercase_ascii (Str.first_chars b 1) ^ Str.string_after b 1
-    ) "" (Str.split (Str.regexp "_") name)
+    ) "" (String.nsplit "_" name)
   in
   let make_camel_case_if_not_set f =
     if f.camel_name = "" then
-- 
2.13.2




More information about the Libguestfs mailing list