From f92076037c2930954aebaea4e0e66f18cdcc833c Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Sun, 11 Aug 1996 22:25:20 -0400 Subject: [PATCH] (hash_is_key_in_hash): Function somehow got lost. From-SVN: r12614 --- gcc/objc/hash.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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; +} -- 2.30.2