correction for deleting items
authorRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 25 Jun 2022 22:53:40 +0000 (08:53 +1000)
committerRalph Ronnquist <ralph.ronnquist@gmail.com>
Sat, 25 Jun 2022 22:53:40 +0000 (08:53 +1000)
pvector/hashvector.c

index 5164ffe2e209291388fafcbf812ae57940ed7233..11fdae845a9837e04e46ebc2450b433078af0ed0 100644 (file)
@@ -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 );
        }
     }