Commit 7f96816a by Jeff Law Committed by Jeff Law

hashtab.c (htab_remove_elt_with_hash): New function.

	* hashtab.c (htab_remove_elt_with_hash): New function.
	(htab_remove_elt): Implement in terms of htab_remove_elt_with_hash.

	* hashtab.h (htab_remove_elt_with_hash): Prototype new function.

From-SVN: r80641
parent f778cbf0
2004-04-13 Jeff Law <law@redhat.com>
* hashtab.h (htab_remove_elt_with_hash): Prototype new function.
2004-03-30 Zack Weinberg <zack@codesourcery.com>
* hashtab.h, splay-tree.h: Use new shorter form of GTY markers.
......
......@@ -166,6 +166,7 @@ extern PTR *htab_find_slot_with_hash PARAMS ((htab_t, const void *,
enum insert_option));
extern void htab_clear_slot PARAMS ((htab_t, void **));
extern void htab_remove_elt PARAMS ((htab_t, void *));
extern void htab_remove_elt_with_hash PARAMS ((htab_t, void *, hashval_t));
extern void htab_traverse PARAMS ((htab_t, htab_trav, void *));
extern void htab_traverse_noresize PARAMS ((htab_t, htab_trav, void *));
......
2004-04-13 Jeff Law <law@redhat.com>
* hashtab.c (htab_remove_elt_with_hash): New function.
(htab_remove_elt): Implement in terms of htab_remove_elt_with_hash.
2004-03-31 Richard Henderson <rth@redhat.com>
* hashtab.c (htab_size): Move to top of file; mark inline.
......
......@@ -600,17 +600,31 @@ htab_find_slot (htab, element, insert)
}
/* This function deletes an element with the given value from hash
table (the hash is computed from the element). If there is no matching
element in the hash table, this function does nothing. */
void
htab_remove_elt (htab, element)
htab_t htab;
PTR element;
{
htab_remove_elt_with_hash (htab, element, (*htab->hash_f) (element));
}
/* This function deletes an element with the given value from hash
table. If there is no matching element in the hash table, this
function does nothing. */
void
htab_remove_elt (htab, element)
htab_remove_elt_with_hash (htab, element, hash)
htab_t htab;
PTR element;
hashval_t hash;
{
PTR *slot;
slot = htab_find_slot (htab, element, NO_INSERT);
slot = htab_find_slot_with_hash (htab, element, hash, NO_INSERT);
if (*slot == EMPTY_ENTRY)
return;
......
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