diff options
author | DJ Delorie <dj@redhat.com> | 2004-04-13 15:23:19 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2004-04-13 15:23:19 +0000 |
commit | d6ea4e809a2514503767c68548d59e6cf50ff510 (patch) | |
tree | 1b954db9cdf0881402b38f4ef92a920ca1040367 /libiberty | |
parent | e793df0b8e45b1c226f2ca684d4c4ff803001988 (diff) | |
download | gdb-d6ea4e809a2514503767c68548d59e6cf50ff510.zip gdb-d6ea4e809a2514503767c68548d59e6cf50ff510.tar.gz gdb-d6ea4e809a2514503767c68548d59e6cf50ff510.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/hashtab.c | 18 |
2 files changed, 21 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 661ca4b..7da2d46 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +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. 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; |