projects
/
SXSI
/
xpathcomp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't index empty texts
[SXSI/xpathcomp.git]
/
tag.ml
diff --git
a/tag.ml
b/tag.ml
index
f0d9062
..
8c77691
100644
(file)
--- a/
tag.ml
+++ b/
tag.ml
@@
-29,13
+29,16
@@
struct
end
module HMap = Map.Make (struct type t = int let compare x y = x - y end)
end
module HMap = Map.Make (struct type t = int let compare x y = x - y end)
+
module HTag =
struct
type t = int
let attribute = T.hash T.attribute
let pcdata = T.hash T.pcdata
module HTag =
struct
type t = int
let attribute = T.hash T.attribute
let pcdata = T.hash T.pcdata
+
let pool = ref HMap.empty
let pool = ref HMap.empty
+
let add_pool s =
let hash = T.hash s in
pool := HMap.add hash s !pool
let add_pool s =
let hash = T.hash s in
pool := HMap.add hash s !pool
@@
-45,10
+48,11
@@
let clear_pool () =
add_pool "";
add_pool T.attribute;
add_pool T.pcdata
add_pool "";
add_pool T.attribute;
add_pool T.pcdata
-
let _ = clear_pool ()
let _ = clear_pool ()
+let init l =
+ clear_pool ()
let tag s =
let hash = T.hash s in
let tag s =
let hash = T.hash s in
@@
-91,4
+95,3
@@
struct
end
include STag
end
include STag
-let _ = Callback.register "caml_hash_tag" tag