Commits

Anonymous committed 38dc98a

update

Comments (0)

Files changed (1)

     | hd::tl,limit -> (hd, (tl,limit))
 end
     
-    
-
 type node = {
   size: int;
   checksum: string;
     | [] -> total_size, acc_md5, acc_m;
     | hd::tl ->
       begin
-        let s, md5, m2 = handle_name acc_m (Filename.concat path hd) in
-        let md5' = Digest.to_hex (Digest.string (md5 ^ acc_md5)) in
+        let filename = Filename.concat path hd in
+        let s, md5, m2 = handle_name acc_m filename in
+        let md5' = Digest.to_hex (Digest.string (filename ^ md5 ^ acc_md5)) in
         fold (total_size + s) (md5') m2 tl
       end
   in
     search_dup_fold m path
 
   else
+    (* TODO: calculating md5 is just heavy *)
     let md5 = Digest.to_hex (Digest.file path) in
     let stat = Unix.stat path in
     let size = stat.Unix.st_size in