summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2011-09-18 09:40:21 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2011-09-18 09:40:21 +0000
commitbd3e65ea7a29c2280c0b302490b9c06911cddbb0 (patch)
tree28a3069ffe9f90aad47b10a8948d99f75f49d067 /stdlib
parent8e33ab4f2dae6619400eb61222e6be2ad9b16da7 (diff)
PR#5349: "replace" uses new key instead of reusing old key.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11205 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/hashtbl.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/hashtbl.ml b/stdlib/hashtbl.ml
index 501213836..6f3ea880b 100644
--- a/stdlib/hashtbl.ml
+++ b/stdlib/hashtbl.ml
@@ -131,7 +131,7 @@ let replace h key info =
raise Not_found
| Cons(k, i, next) ->
if compare k key = 0
- then Cons(k, info, next)
+ then Cons(key, info, next)
else Cons(k, i, replace_bucket next) in
let i = key_index h key in
let l = h.data.(i) in
@@ -320,7 +320,7 @@ module MakeSeeded(H: SeededHashedType): (SeededS with type key = H.t) =
raise Not_found
| Cons(k, i, next) ->
if H.equal k key
- then Cons(k, info, next)
+ then Cons(key, info, next)
else Cons(k, i, replace_bucket next) in
let i = key_index h key in
let l = h.data.(i) in