diff options
| -rw-r--r-- | pez.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; } |