- struct mapping *mp = mappings + location;
- /* We don't really remove an entry from the hash table: we just
- mark it as deleted. This is because there may be other
- entries located after this entry whose hash points to a
- location before this entry. (Example: keys A, B and C have
- the same hash. If you were to really *delete* B from the
- table, C could no longer be found.) */
-
- /* Optimization addendum: if the mapping that follows LOCATION
- is already empty, that is a sure sign that nobody depends on
- LOCATION being non-empty. (This is because we're using
- linear probing. This would not be the case with double
- hashing.) In that case, we may safely delete the mapping. */
-
- /* This could be generalized so that the all the non-empty
- locations following LOCATION are simply shifted leftward. It
- would make deletion a bit slower, but it would remove the
- ugly DELETED_ENTRY_P checks from all the rest of the code,
- making the whole thing faster. */
- int location_after = (location + 1) == ht->size ? 0 : location + 1;
- struct mapping *mp_after = mappings + location_after;
-
- if (EMPTY_ENTRY_P (mp_after->key))
- {
- mp->key = ENTRY_EMPTY;
- --ht->fullness;
- }
- else
- mp->key = ENTRY_DELETED;