aboutsummaryrefslogtreecommitdiff
path: root/libiberty/hashtab.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2004-04-13 08:48:56 -0600
committerJeff Law <law@gcc.gnu.org>2004-04-13 08:48:56 -0600
commit7f96816adb80b45faef4c7f04464584128dc69c6 (patch)
tree29d3fb80f1928330a799e287f6a657a318546016 /libiberty/hashtab.c
parentf778cbf0919aff0d88a1fe68ac0fd6ef753813ca (diff)
downloadgcc-7f96816adb80b45faef4c7f04464584128dc69c6.zip
gcc-7f96816adb80b45faef4c7f04464584128dc69c6.tar.gz
gcc-7f96816adb80b45faef4c7f04464584128dc69c6.tar.bz2
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
Diffstat (limited to 'libiberty/hashtab.c')
-rw-r--r--libiberty/hashtab.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index f775166..2639428 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -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;