From f78bdf5872a5a3dd96e26f94173d272e0227b785 Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sun, 26 Jun 2022 08:53:40 +1000 Subject: [PATCH] correction for deleting items --- pvector/hashvector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pvector/hashvector.c b/pvector/hashvector.c index 5164ffe..11fdae8 100644 --- a/pvector/hashvector.c +++ b/pvector/hashvector.c @@ -105,8 +105,9 @@ int hashvector_delete(hashvector *hv,void *item) { } *p = HV_HOLE; hv->holes++; + hv->fill--; if ( hv->table.size > 256 ) { - if ( hv->fill < hv->table.size / 2 ) { + if ( hv->fill < hv->table.size / 4 ) { hashvector_resize( hv, hv->table.size / 2 ); } } -- 2.39.2