Skip to content

hhas

Category: hash
GitHub: cute_hashtable.h


Check to see if an item exists in the table.

#define hhas(h, k) cf_hashtable_has(h, k)
Parameters Description
h The hashtable. Can be NULL. Needs to be a pointer to the type of items in the table.
k The key for lookups. Each {key, item} pair must be unique. Keys are always typecasted to uint64_t e.g. you can use pointers as keys.

Return Value

Returns true if the item was found, false otherwise.

Code Example

Checks if an item exists in the table.

htbl v2 table = NULL;
hadd(table, 10, V2(-1, 1));
CF_ASSERT(hhas(table, 10));
hfree(table);

htbl
hset
hadd
hget
hfind
hget_ptr
hfind_ptr
hfree
hdel
hclear
hkeys
hitems
hswap
hsize
hcount