Skip to content

Conversation

@charlesgregory
Copy link

This is basically a clone of #3 which I messed up due to a rebase. For more information about this pull request visit #3.

@jblachly
Copy link
Member

If you can add README update explaining the cached parameter looks GTG

@charlesgregory
Copy link
Author

I updated the benchmarks (this is also reflected in the readme). I think we should also add a deletion benchmark since that is really where khashl is supposed to shine.

Copy link
Member

@jblachly jblachly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the few issues here and we can merge

return (a.key == b.key);
}

bool kh_hash_equal(T)(T* a, T* b)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see nathans/my changes (most recent commit) whereby this template fn needs scope const (really just the const) to correctly instantiate for char * which is not in your unit tests (see also the unit tests I added and add them here)

{
/// If using hash-caching we check equality of the hashes first
/// before checking the equality of keys themselves
static if(cached) return (a.hash == b.hash) && (strcmp(a, b) == 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a is the bucket type does this [strcmp(a,b)] really work? Need char * tests , see above

{
pragma(inline, true)
{
auto kh_hash_func(T)(T key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return key;
}

auto kh_hash_func(T)(T key)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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