public void AddError(ParseError error) { bool found = _errors.Any(e => e.Start == error.Start && e.Length == error.Length && e.ErrorType == error.ErrorType); if (!found) { _errors.Add(error); } }
public void AddError(ParseError error) { bool found = false; foreach (IParseError e in _errors) { if (e.Start == error.Start && e.Length == error.Length && e.ErrorType == error.ErrorType) { found = true; break; } } if (!found) { _errors.Add(error); } }