src/hashing/hash_table.h
/**
 * Check whether the given key exists in the hash table. The key cannot be NULL.
 * Returns 1 if so, 0 otherwise.
 */
Check whether the given key exists in the hash table. The key cannot be NULL.
Returns 1 if so, 0 otherwise.
Check whether the given key exists in the hash table . The key cannot be NULL . Returns 1 if so 0 otherwise .
inline char hash_table_contains(HashTable* hash_table, void* key) {
	size_t hash_value = HASH_POINTER(key) & (hash_table->bucket_count - 1);
	int i;
	for (i = 0; i < hash_table->chain_sizes[hash_value]; ++i)
		if (hash_table->buckets[hash_value][i] == key)
			return 1;
	return 0;
}
inline char hash_table_contains ( HashTable * hash_table , void * key ) { size_t hash_value = HASH_POINTER ( key ) & ( hash_table -> bucket_count - 1 ) ; int i ; for ( i = 0 ; i < hash_table -> chain_sizes [ hash_value ] ; ++ i ) if ( hash_table -> buckets [ hash_value ] [ i ] == key ) return 1 ; return 0 ; }
Check whether the given key exists in the hash table.
Check whether the given key exists in the hash table .
// assert(key != NULL);