hashmap.c
hashmap.c copied to clipboard
Support hashmap_get_by_hash, and hashmap_set_by_hash
As part of a project we're working on, we are not creating a key based on the item stored in the hash map. We have a pointer to the item which we need to lookup within the hash map at periodic intervals.
Maybe I'm missing something, but isn't this the same as defining a hash function such as
uint64_t my_hash_fn (
const void *item, uint64_t seed0, uint64_t seed1)
{ return (uint64_t) item; }
for your hash map? (I am not grasping the use case, since if you are looking up something by pointer, you already know how to get it)
Considering there is the function hashmap_set_with_hash now, this PR could be closed...