private void CleanResultCodes() { List <ResultCode> removeList = new List <ResultCode>(); foreach (ResultCode resultCode in ResultCodes) { if (resultCode.Count < 1) { removeList.Add(resultCode); } } foreach (ResultCode resultCode in removeList) { ResultCodes.Remove(resultCode); } }