Commit e10dee4c authored by POTTIER Francois's avatar POTTIER Francois

Remove [Misc.new_intern].

parent a10eaa7f
......@@ -259,31 +259,6 @@ let map_opt f l =
| Some y -> y :: ys
) [] l))
let new_intern capacity =
(* Set up a a hash table, mapping strings to unique integers. *)
let module H = Hashtbl.Make(struct
type t = string
let equal = (=)
let hash = Hashtbl.hash
end) in
let table = H.create capacity in
(* This counts the calls to [intern]. *)
let c = ref 0 in
(* A string is mapped to a unique string, as follows. *)
let intern s =
c := !c + 1;
try
H.find table s
with Not_found ->
H.add table s s;
s
and verbose () =
Printf.fprintf stderr
"%d calls to intern; %d unique strings.\n%!"
!c (H.length table)
in
intern, verbose
let new_encode_decode capacity =
(* Set up a a hash table, mapping strings to unique integers. *)
let module H = Hashtbl.Make(struct
......
......@@ -146,13 +146,6 @@ val postincrement: int ref -> int
is in [l], preserving the order of elements of [l]. *)
val map_opt : ('a -> 'b option) -> 'a list -> 'b list
(* [new_intern capacity] creates a new service for interning (hash-consing)
strings. [capacity] is the initial capacity of the internal hash table.
[new_intern] returns a pair [intern, verbose] where [intern] is the
hash-consing service and [verbose] prints statistics about the use of
the service so far. *)
val new_intern: int -> (string -> string) * (unit -> unit)
(* [new_encode_decode capacity] creates a new service for assigning unique
integer codes to strings. [capacity] is the initial capacity of the
internal hash table. [new_encode_decode] returns a triple [encode, decode,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment