Skip to content

Support hashmap_get_by_hash, and hashmap_set_by_hash#20

Open
okanaganrusty wants to merge 3 commits intotidwall:masterfrom
okanaganrusty:get_by_hash
Open

Support hashmap_get_by_hash, and hashmap_set_by_hash#20
okanaganrusty wants to merge 3 commits intotidwall:masterfrom
okanaganrusty:get_by_hash

Conversation

@okanaganrusty
Copy link

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.

@scossu
Copy link
Contributor

scossu commented Mar 30, 2022

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)

@ghost
Copy link

ghost commented Sep 2, 2023

Considering there is the function hashmap_set_with_hash now, this PR could be closed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants