|
@@ -60,18 +60,18 @@ module StringHashtbl = struct
|
|
end
|
|
end
|
|
|
|
|
|
module IntHashtbl = struct
|
|
module IntHashtbl = struct
|
|
- type 'value t = 'value IntMap.t ref
|
|
|
|
-
|
|
|
|
- let add this key v = this := IntMap.add key v !this
|
|
|
|
- let copy this = ref !this
|
|
|
|
- let create () = ref IntMap.empty
|
|
|
|
- let find this key = IntMap.find key !this
|
|
|
|
- let fold f this acc = IntMap.fold f !this acc
|
|
|
|
- let is_empty this = IntMap.is_empty !this
|
|
|
|
- let iter f this = IntMap.iter f !this
|
|
|
|
- let mem this key = IntMap.mem key !this
|
|
|
|
- let remove this key = this := IntMap.remove key !this
|
|
|
|
- let clear this = this := IntMap.empty
|
|
|
|
|
|
+ type 'value t = (int, 'value) Hashtbl.t
|
|
|
|
+
|
|
|
|
+ let add this key v = Hashtbl.replace this key v
|
|
|
|
+ let copy this = Hashtbl.copy this
|
|
|
|
+ let create () = Hashtbl.create 0
|
|
|
|
+ let find this key = Hashtbl.find this key
|
|
|
|
+ let fold f this acc = Hashtbl.fold f this acc
|
|
|
|
+ let is_empty this = Hashtbl.length this = 0
|
|
|
|
+ let iter f this = Hashtbl.iter f this
|
|
|
|
+ let mem this key = Hashtbl.mem this key
|
|
|
|
+ let remove this key = Hashtbl.remove this key
|
|
|
|
+ let clear this = Hashtbl.clear this
|
|
end
|
|
end
|
|
|
|
|
|
type vregex = {
|
|
type vregex = {
|