bug Weak.Create(_).iter
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5033 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
6f75d4f557
commit
794633663d
|
@ -116,7 +116,15 @@ module Make (H : Hashtbl.HashedType) : (S with type data = H.t) = struct
|
|||
Array.fold_right (fold_bucket 0) t.table init
|
||||
;;
|
||||
|
||||
let iter f t = fold (fun d () -> ()) t ();;
|
||||
let iter f t =
|
||||
let rec iter_bucket i b =
|
||||
if i >= length b then () else
|
||||
match get b i with
|
||||
| Some v -> f v; iter_bucket (i+1) b
|
||||
| None -> iter_bucket (i+1) b
|
||||
in
|
||||
Array.iter (iter_bucket 0) t.table
|
||||
;;
|
||||
|
||||
let count t =
|
||||
let rec count_bucket i b accu =
|
||||
|
|
Loading…
Reference in New Issue