/* Remove the entry matching KEY from hash table H, if there is one. */
-void
+bool
hash_remove_from_table (struct Lisp_Hash_Table *h, Lisp_Object key)
{
Lisp_Object hash_code = h->test.hashfn (key, h);
ptrdiff_t start_of_bucket = XUFIXNUM (hash_code) % ASIZE (h->index);
ptrdiff_t prev = -1;
+ bool deleted = false;
for (ptrdiff_t i = HASH_INDEX (h, start_of_bucket);
0 <= i;
h->next_free = i;
h->count--;
eassert (h->count >= 0);
+ deleted = true;
break;
}
prev = i;
}
+
+ return deleted;
}
ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object *);
ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
Lisp_Object);
-void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
+bool hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
extern struct hash_table_test const hashtest_eq, hashtest_eql, hashtest_equal;
extern void validate_subarray (Lisp_Object, Lisp_Object, Lisp_Object,
ptrdiff_t, ptrdiff_t *, ptrdiff_t *);