From 14c235d91d20ec2ac27bc93235d6b28f5abc4933 Mon Sep 17 00:00:00 2001 From: law Date: Tue, 13 Apr 2004 14:48:56 +0000 Subject: * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80641 138bc75d-0d04-0410-961f-82ee72b054a4 --- libiberty/hashtab.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'libiberty/hashtab.c') diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c index f7751664f04..2639428df9c 100644 --- a/libiberty/hashtab.c +++ b/libiberty/hashtab.c @@ -599,18 +599,32 @@ htab_find_slot (htab, element, insert) 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; -- cgit v1.2.1