Commits

camlspotter committed 977ab95

removed Hashtbl.memoize since Spot.Base.memoize exists #SENSITIVE

Comments (0)

Files changed (2)

   | None -> Hashtbl.remove tbl k
   | Some v -> Hashtbl.replace tbl k v
 
-let memoize tbl f k =
-  try 
-    Hashtbl.find tbl k 
-  with
-  | Not_found ->
-      let v = f k in
-      Hashtbl.replace tbl k v;
-      v
-
 let concat tbls =
   let t = Hashtbl.create 101 in (* CR jfuruse: fixed *)
   List.iter (Hashtbl.iter (Hashtbl.add t)) tbls;
 val find_default : 'b -> ('a, 'b) Hashtbl.t -> 'a -> 'b
 val find_or_add  : ('a -> 'b) -> ('a, 'b) Hashtbl.t -> 'a -> 'b
 val alter        : ('a, 'b) Hashtbl.t -> 'a -> ('b option -> 'b option) -> unit
-val memoize      : ('a, 'b) Hashtbl.t -> ('a -> 'b) -> 'a -> 'b
 
 val concat : ('a, 'b) Hashtbl.t list -> ('a, 'b) Hashtbl.t
 (** Keys bound more than once in the tables are multiply bound in the result.