You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
krivit
changed the title
Helper functions for khash
Helper functions for khash (patch available)
Sep 3, 2018
I've been using
klib
'skhash
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 keykey
, ordefval
if the key is not found.kh_set(name, h, key, val)
: Set the value corresponding to keykey
toval
, inserting into table ifkey
is absent and overwriting if present.kh_unset(name, h, key)
: A more user-friendlykh_del()
: checks ifkey
is in the table, and deletes if it is.I would be happy to submit a pull request incorporating these.
The text was updated successfully, but these errors were encountered: