summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2016-03-10 14:42:36 +0100
committerAlain Frisch <alain@frisch.fr>2016-03-10 15:10:47 +0100
commitaf09eacaf2d651ba5b28394b15db8f54d150aca4 (patch)
tree01f9af2ff5afcde00cc136dc38c5b354133555a8
parent0310ff44155513ee944e64cbd54c6d5c46153d59 (diff)
downloadocaml-af09eacaf2d651ba5b28394b15db8f54d150aca4.tar.gz
Bug fix: Hashtbl.filter_map_inplace did not correctly update the size field.
-rw-r--r--stdlib/hashtbl.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/hashtbl.ml b/stdlib/hashtbl.ml
index 59e41712fc..955f63845d 100644
--- a/stdlib/hashtbl.ml
+++ b/stdlib/hashtbl.ml
@@ -200,7 +200,7 @@ let filter_map_inplace f h =
Empty
| Cons(k, d, rest) ->
match f k d with
- | None -> do_bucket rest
+ | None -> h.size <- h.size - 1; do_bucket rest
| Some new_d -> Cons(k, new_d, do_bucket rest)
in
let d = h.data in