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

Modify qd_hash_retrieve_str in hash.c to return QD_ERROR_NOT_FOUND if the val is not found for key #1568

Closed
ganeshmurthy opened this issue Jul 15, 2024 · 0 comments
Milestone

Comments

@ganeshmurthy
Copy link
Contributor

Right now the qd_hash_retrieve_str function always returns QD_ERROR_NONE. It should look like this instead

qd_error_t qd_hash_retrieve_str(qd_hash_t *h, const unsigned char *key, void **val)
{
	qd_hash_item_t *item = qd_hash_internal_get_item_str(h,
                                                         qd_hash_get_bucket_str(h, key),
                                                         key);
    if (item) {
        *val = item->v.val;
        return QD_ERROR_NONE;
	} else {
        *val = 0;
        return QD_ERROR_NOT_FOUND;
    }
}
@ganeshmurthy ganeshmurthy added this to the 3.0.0 milestone Sep 12, 2024
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

1 participant