mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] Changes to mldonkey/src/utils/cdk/heap.ml


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/utils/cdk/heap.ml
Date: Sun, 17 Jul 2005 20:52:34 -0400

Index: mldonkey/src/utils/cdk/heap.ml
diff -u mldonkey/src/utils/cdk/heap.ml:1.3 mldonkey/src/utils/cdk/heap.ml:1.4
--- mldonkey/src/utils/cdk/heap.ml:1.3  Wed Jun  1 22:19:57 2005
+++ mldonkey/src/utils/cdk/heap.ml      Mon Jul 18 00:52:31 2005
@@ -31,6 +31,19 @@
   let memstat_list = List.rev !memstat_functions in
   if output_type = true then
     begin
+      let split_l s c =
+        let len = String.length s in
+        let rec iter pos =
+          try
+            if pos = len then [""] else
+            let pos2 = String.index_from s pos c in
+            if pos2 = pos then "" :: iter (pos+1) else
+              (String.sub s pos (pos2-pos)) :: (iter (pos2+1))
+          with _ -> [String.sub s pos (len-pos)]
+        in
+        iter 0
+      in
+(*
       let split_string c str =
         let rec aux s acc =
           try  let ind=String.index s c in
@@ -39,7 +52,7 @@
           with Not_found -> List.rev (s::acc)
           in aux str []; in
       let split_lines = split_string '\n' in
-
+ *)
       List.iter (fun (m,f) ->
 (*
           html_mods_table_header buf "memstatsTable" "memstats" [
@@ -49,7 +62,7 @@
 \\>\\<tr\\>\\<td class=\\\"srh\\\" \\>Module %s\\</td\\>\\</tr\\>" m;
           let buftmp = Buffer.create 100 in
           f level buftmp;
-          let listtmp = split_lines (Buffer.contents buftmp) in
+          let listtmp = split_l (Buffer.contents buftmp) '\n' in
           (List.iter (fun s ->
 (*
               html_mods_td buf [




reply via email to

[Prev in Thread] Current Thread [Next in Thread]