Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helper functions for khash (patch available) #105

Open
krivit opened this issue Sep 3, 2018 · 1 comment
Open

Helper functions for khash (patch available) #105

krivit opened this issue Sep 3, 2018 · 1 comment

Comments

@krivit
Copy link

krivit commented Sep 3, 2018

I've been using klib's khash for my own project, and I've written some convenience functions. I was wondering if there might be interest in incorporating them into the core implementation:

  • kh_getval(name, h, key, defval): Return the value corresponding to key key, or defval if the key is not found.
  • kh_set(name, h, key, val): Set the value corresponding to key key to val, inserting into table if key is absent and overwriting if present.
  • kh_unset(name, h, key): A more user-friendly kh_del(): checks if key is in the table, and deletes if it is.

I would be happy to submit a pull request incorporating these.

@krivit krivit changed the title Helper functions for khash Helper functions for khash (patch available) Sep 3, 2018
@rofl0r
Copy link

rofl0r commented Jun 22, 2019

this sounds useful. would you mind sharing your patch, @krivit ?

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

No branches or pull requests

2 participants