.. which is a working implementation of clear, though probably superfluous.
and...
int i = 0;
while(i < collection.Count)
{
collection.Delete(i);
i++;
}
which does try to walk along the list and is broken.
Also, .Net has a specific exception to stop you modifying a collection while an enumerator is walking along it. Google for "Collection was modified; enumeration operation may not execute"
and...
which does try to walk along the list and is broken.Also, .Net has a specific exception to stop you modifying a collection while an enumerator is walking along it. Google for "Collection was modified; enumeration operation may not execute"