summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pez.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/pez.c b/pez.c
index 2059387..34a0e76 100644
--- a/pez.c
+++ b/pez.c
@@ -716,9 +716,14 @@ delarray(PezContext *cx, Array *arr)
static void
delstring(PezContext *cx, Str *str)
{
- Str **slot = strpool_lookup(cx, str->dat, str->n);
- assert(slot && *slot == str);
- *slot = NULL;
+ uint N = cx->strpool.N;
+ for (uint i = fnv1a(FNV1A_INI, str->dat, str->n) & (N - 1);; i = (i + 1) & (N - 1)) {
+ Str **slot = &cx->strpool.dat[i];
+ if (*slot == str) {
+ *slot = NULL;
+ break;
+ }
+ }
++cx->strpool.deleted;
--cx->strpool.count;
}