File tree Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Expand file tree Collapse file tree 3 files changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ let get_children_watches con path =
317
317
let path = path ^ " /" in
318
318
List. concat
319
319
(Hashtbl. fold
320
- (fun p w l -> if String. startswith path p then w :: l else l)
320
+ (fun p w l -> if String. starts_with ~prefix: path p then w :: l else l)
321
321
con.watches []
322
322
)
323
323
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ let log_destination_of_string s =
25
25
let prefix = " syslog:" in
26
26
let len_prefix = String. length prefix in
27
27
let len = String. length s in
28
- if String. startswith prefix s then
28
+ if String. starts_with ~ prefix s then
29
29
Syslog
30
30
(Syslog. facility_of_string (String. sub s len_prefix (len - len_prefix)))
31
31
else
@@ -435,7 +435,7 @@ let live_update () =
435
435
let xb_answer ~tid ~con ~ty data =
436
436
let print, level =
437
437
match ty with
438
- | Xenbus.Xb.Op. Error when String. startswith " ENOENT" data ->
438
+ | Xenbus.Xb.Op. Error when String. starts_with ~prefix: " ENOENT" data ->
439
439
(! access_log_read_ops, Warn )
440
440
| Xenbus.Xb.Op. Error ->
441
441
(true , Warn )
Original file line number Diff line number Diff line change @@ -82,18 +82,6 @@ module String = struct
82
82
let a = String. sub s 0 i
83
83
and b = String. sub s (i + 1 ) (String. length s - i - 1 ) in
84
84
a :: split ~limit: nlimit c b
85
-
86
- let fold_left f accu string =
87
- let accu = ref accu in
88
- for i = 0 to length string - 1 do
89
- accu := f ! accu string .[i]
90
- done ;
91
- ! accu
92
-
93
- (* * True if string 'x' starts with prefix 'prefix' *)
94
- let startswith prefix x =
95
- let x_l = String. length x and prefix_l = String. length prefix in
96
- prefix_l < = x_l && String. sub x 0 prefix_l = prefix
97
85
end
98
86
99
87
module Unixext = struct
You can’t perform that action at this time.
0 commit comments