@@ -42,9 +42,7 @@ module Networks = Generic.MakeStateless (struct
4242 )
4343
4444 let construct_tree tree path =
45- let nodes =
46- Xapi_stdext_std.Xstringext.String. split_f (fun s -> s = '/' ) path
47- in
45+ let nodes = Astring.String. cuts ~empty: false ~sep: " /" path in
4846 add_path_to_tree tree nodes
4947
5048 let rec list_helper children = function
@@ -60,9 +58,7 @@ module Networks = Generic.MakeStateless (struct
6058 )
6159
6260 let list (T (_root , children )) path =
63- let nodes =
64- Xapi_stdext_std.Xstringext.String. split_f (fun s -> s = '/' ) path
65- in
61+ let nodes = Astring.String. cuts ~empty: false ~sep: " /" path in
6662 list_helper children nodes
6763
6864 let transform input =
@@ -231,9 +227,7 @@ module Initial_guest_metrics = Generic.MakeStateless (struct
231227 )
232228
233229 let construct_mtree mtree (path , leaf_value ) =
234- let nodes =
235- Xapi_stdext_std.Xstringext.String. split_f (fun s -> s = '/' ) path
236- in
230+ let nodes = Astring.String. cuts ~empty: false ~sep: " /" path in
237231 add_leaf_to_mtree nodes leaf_value mtree
238232
239233 let rec list_helper children = function
@@ -254,9 +248,7 @@ module Initial_guest_metrics = Generic.MakeStateless (struct
254248 | Lf (_ , _ ) ->
255249 []
256250 | Mt (_ , children ) ->
257- let nodes =
258- Xapi_stdext_std.Xstringext.String. split_f (fun s -> s = '/' ) path
259- in
251+ let nodes = Astring.String. cuts ~empty: false ~sep: " /" path in
260252 list_helper children nodes
261253
262254 let rec lookup_helper mtree = function
@@ -274,9 +266,7 @@ module Initial_guest_metrics = Generic.MakeStateless (struct
274266 )
275267
276268 let lookup mtree path =
277- let nodes =
278- Xapi_stdext_std.Xstringext.String. split_f (fun s -> s = '/' ) path
279- in
269+ let nodes = Astring.String. cuts ~empty: false ~sep: " /" path in
280270 lookup_helper mtree nodes
281271
282272 let transform input =
0 commit comments