// Update the list of metals void updateAllMetals() { // this Variable only use is to iterate over a HashSet, we remove from mList directly var clone = new HashSet <Metal>(mList, mList.Comparer); foreach (Metal entry in clone) { Metal M = entry; M.UpdateMetal(); // if balance is reached, than there is no need to update the metal afterwards if (M.EqReached()) { // So we remove the metal from the list of updates removeMetal(M); } } }