In other words, is this safe?
Hashtable myDict = ... //fill with some data
foreach (DictionaryEntry pair in myDict)
{
if (someCondition)
myDict.Remove(pair.Key);
}
It doesnt seem to have any side effects in my application so far.
edit: i have to mention that in my specific case, this dictionary contains only 1 entry.
edit2: sorry, the datatype is a Hashtable not a Dictionary.