Commit fdf216cc authored by Pekka Pessi's avatar Pekka Pessi

htable.h: if entry to be removed is not in hash table, ignore error silently with -DNDEBUG

darcs-hash:20061208122638-65a35-d3665b647e8776fb6feb791dead54203c4754960.gz
parent b8938063
......@@ -225,13 +225,16 @@ void prefix##_remove(prefix##_t *pr, entry_t const *e) \
size_t i, j, k; \
size_t size = pr->pr##_size; \
entry_t **htable = pr->pr##_table; \
\
if (!e) return; \
\
/* Search for entry */ \
for (i = hfun(e) % size; htable[i]; i = (i + 1) % size) \
if (e == htable[i]) \
break; \
\
assert(htable[i]); if (!htable[i]) abort(); \
/* Entry is not in table? */ \
assert(htable[i]); if (!e) return; \
\
/* Move table entries towards their primary place */ \
for (j = (i + 1) % size; htable[j]; j = (j + 1) % size) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment