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

Problem: zlistx_head always return null #1948

Merged
merged 1 commit into from
Nov 11, 2018
Merged

Conversation

somdoron
Copy link
Member

Solution: Fix the function and return the first item

For comparison, following are the implementations of zlistx_head and zlist_first (actually works) before the change, the difference should only be the cursor change, however the implementation is different:

void *
zlistx_head (zlistx_t *self)
{
    assert (self);
    return self->head? self->head->item: NULL;
}

void *
zlistx_first (zlistx_t *self)
{
    assert (self);
    self->cursor = self->head->next;
    return self->cursor == self->head? NULL: self->cursor->item;
}

Solution: Fix the function and return the first item
@sappo sappo merged commit 592ec40 into zeromq:master Nov 11, 2018
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