From af09eacaf2d651ba5b28394b15db8f54d150aca4 Mon Sep 17 00:00:00 2001 From: Alain Frisch Date: Thu, 10 Mar 2016 14:42:36 +0100 Subject: [PATCH] Bug fix: Hashtbl.filter_map_inplace did not correctly update the size field. --- stdlib/hashtbl.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/hashtbl.ml b/stdlib/hashtbl.ml index 59e41712f..955f63845 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