public static SubSomething SimpleLoop(IEnumerable <Something> source) { foreach (Something val in source) { SubSomething subVal = val as SubSomething; if (subVal != null) { return(subVal); } } return(null); }
private static IEnumerable <Something> GenerateTestInput() { List <Something> data = new List <Something>(); foreach (int i in Enumerable.Range(0, 1000000)) { Something item = new Something(i.ToString()); if (i == 999900) { item = new SubSomething(i.ToString()); } data.Add(item); } return(data); }
protected override bool OutputComparer(SubSomething left, SubSomething right) { return(left.Id == right.Id); }