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

Extend judy_128_map with iterator helpers #83

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

knutin
Copy link
Member

@knutin knutin commented Jul 2, 2016

This PR includes some extra methods in judy_128_map which allows iterating over the array without using j128m_fold. The API works exactly like the normal Judy API, except that you need to explicitly pass references.

__uint128_t idx = 0;
PWord_t pv = NULL;
j128m_find(&jm, &pv, &idx);
while (pv != NULL) {
    /* Do something with *pv */
     j128m_next(&jm, &pv, &idx);
}

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2016

CLA assistant check
All committers have signed the CLA.

@@ -17,6 +17,12 @@ Word_t *j128m_insert(struct judy_128_map *j128m, __uint128_t key);

Word_t *j128m_get(const struct judy_128_map *j128m, __uint128_t key);

int j128m_del(struct judy_128_map *j128m, __uint128_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.

@knutin I guess j128_del doesn't exist so this can be removed?

Copy link
Contributor

Choose a reason for hiding this comment

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

It does, at least in some local branch I was using it, let me see..

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.

None yet

4 participants