summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2012-05-24 15:12:37 +0000
committerDamien Doligez <damien.doligez-inria.fr>2012-05-24 15:12:37 +0000
commit8a216cd3bbf416475e416afed6467f20cc7475d0 (patch)
tree18401bda54107f99e0bfe5314a14046e95d506b4
parent397d0040de499149f6a8aa287b65e6a8e7f9cd24 (diff)
fix two bugs in commit 12453
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@12476 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--stdlib/hashtbl.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/stdlib/hashtbl.ml b/stdlib/hashtbl.ml
index 01614846d..80a039959 100644
--- a/stdlib/hashtbl.ml
+++ b/stdlib/hashtbl.ml
@@ -60,7 +60,7 @@ let rec power_2_above x n =
let create ?(random = !randomized) initial_size =
let s = power_2_above 16 initial_size in
let seed = if random then Random.State.bits (Lazy.force prng) else 0 in
- { initial_size; size = 0; seed = seed; data = Array.make s Empty }
+ { initial_size = s; size = 0; seed = seed; data = Array.make s Empty }
let clear h =
h.size <- 0;
@@ -76,7 +76,7 @@ let reset h =
clear h
else begin
h.size <- 0;
- h.data <- Array.create len Empty
+ h.data <- Array.make h.initial_size Empty
end
let copy h = { h with data = Array.copy h.data }
@@ -88,7 +88,7 @@ let resize indexfun h =
let osize = Array.length odata in
let nsize = osize * 2 in
if nsize < Sys.max_array_length then begin
- let ndata = Array.create nsize Empty in
+ let ndata = Array.make nsize Empty in
h.data <- ndata; (* so that indexfun sees the new bucket count *)
let rec insert_bucket = function
Empty -> ()