E
Edward Diener
If I am enumerating through a collection, will removing the entry which is
my current one destroy my ability to keep enumerating the remaining elements
successfully. In my case the collection is a hybrid dictionary and while I
am enumerating the elements I want to remove the current one depending on
its value. Of course I know the technique of keeping a list of keys in a
separate array, to remove the appropriate ones after my enumeration has
finished, but I would like to know if this is necessary with .NET
collections or if I can remove while I am enumerating instead..
my current one destroy my ability to keep enumerating the remaining elements
successfully. In my case the collection is a hybrid dictionary and while I
am enumerating the elements I want to remove the current one depending on
its value. Of course I know the technique of keeping a list of keys in a
separate array, to remove the appropriate ones after my enumeration has
finished, but I would like to know if this is necessary with .NET
collections or if I can remove while I am enumerating instead..