X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=tree.ml;h=24fca560141675eb4547e2ba60969adec31352ed;hb=c5f06d325240c808a9be4d71e20fc01969420bb3;hp=730e174172e7f3c5231be6c4eaa2b06a1da22dad;hpb=477c1bef21a38e8371a745da9491fd6a6aae2aa5;p=SXSI%2Fxpathcomp.git diff --git a/tree.ml b/tree.ml index 730e174..24fca56 100644 --- a/tree.ml +++ b/tree.ml @@ -358,6 +358,7 @@ let load ?(sample=64) str = let fd = Unix.openfile str [ Unix.O_RDONLY ] 0o644 in let in_c = Unix.in_channel_of_descr fd in let _ = set_binary_mode_in in_c true in + let load_table () = (let ms = input_line in_c in if ms <> magic_string then failwith "Invalid index file"); (let vs = input_line in_c in if vs <> version_string then failwith "Invalid version file"); let table : (Tag.t,(Ptset.Int.t*Ptset.Int.t*Ptset.Int.t*Ptset.Int.t)) Hashtbl.t = @@ -375,11 +376,15 @@ let load ?(sample=64) str = (* The in_channel read a chunk of fd, so we might be after the start of the XMLTree save file. Reset to the correct position *) - ignore(Unix.lseek fd (pos_in in_c) Unix.SEEK_SET); - let tree = { doc = tree_load fd; - ttable = ntable;} - in close_in in_c; - tree + ntable + in + let _ = Printf.eprintf "\nLoading tag table : " in + let ntable = time (load_table) () in + ignore(Unix.lseek fd (pos_in in_c) Unix.SEEK_SET); + let tree = { doc = tree_load fd; + ttable = ntable;} + in close_in in_c; + tree