From: Richard Kenner Date: Mon, 12 Aug 1996 02:25:20 +0000 (-0400) Subject: (hash_is_key_in_hash): Function somehow got lost. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f92076037c2930954aebaea4e0e66f18cdcc833c;p=gcc.git (hash_is_key_in_hash): Function somehow got lost. From-SVN: r12614 --- diff --git a/gcc/objc/hash.c b/gcc/objc/hash.c index 67b97507bd6..6d67aa00ab0 100644 --- a/gcc/objc/hash.c +++ b/gcc/objc/hash.c @@ -251,3 +251,22 @@ hash_value_for_key (cache_ptr cache, const void *key) return retval; } + +/* Given KEY, return YES if it exists in the CACHE. + Return NO if it does not */ + +BOOL +hash_is_key_in_hash (cache_ptr cache, const void *key) +{ + node_ptr node = cache->node_table[(*cache->hash_func)(cache, key)]; + + if (node) + do { + if ((*cache->compare_func)(node->key, key)) + return YES; + else + node = node->next; + } while (node); + + return NO; +}