pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:6826:    *! at the end of the list.    *!    *! @seealso    *! @[prev()]    */    PIKEFUN mixed _iterator_next()    flags ID_PROTECTED;    {    struct pike_list_node *next;    if (!THIS->cur) { -  add_ref(THIS->cur = List__get_iterator_find_parent()->head); +  add_ref(THIS->cur = next = List__get_iterator_find_parent()->head);    THIS->ind = 0;    } else if ((next = THIS->cur->next)) {    free_list_node(THIS->cur);    add_ref(THIS->cur = next);    THIS->ind++;    } else {    /* We are at the tail sentinel. */    next = TAIL_TO_LIST(THIS->cur)->head;    free_list_node(THIS->cur);    add_ref(THIS->cur = next);
pike.git/src/builtin.cmod:6861:    *! Returns @expr{1@} on success, and @expr{0@} (zero)    *! at the end of the list.    *!    *! @seealso    *! @[prev()]    */    PIKEFUN int(0..1) next() /* Compat. */    {    struct pike_list_node *next;    if (!THIS->cur) { -  add_ref(THIS->cur = List__get_iterator_find_parent()->head); +  add_ref(THIS->cur = next = List__get_iterator_find_parent()->head);    THIS->ind = 0;    } else if ((next = THIS->cur->next)) {    free_list_node(THIS->cur);    add_ref(THIS->cur = next);    THIS->ind++;    }    if (THIS->cur->next) {    RETURN 1;    }    /* End sentinel. */