Menu

#8 ListIterator remove() Bug

open
nobody
None
5
2005-03-26
2005-03-26
Anonymous
No

The ListIterator has to correct the current index
position when removing some Element while iterating.
Otherwise it will skip the Element wich moves to the
same position as the removed element.

This should fix it:

function remove()
{
$this->_index = $this->_element;
array_splice($this->_values, $this->_element, 1);
}

Cheers

Discussion


Log in to post a comment.