internal static void ForEach <T>(GenericSequence <T> sequence, Action <T> processNext) { foreach (T value in sequence) { processNext(value); } }
internal static void CompiledForEach <T>(GenericSequence <T> sequence, Action <T> process) { GenericIterator <T> iterator = sequence.GetEnumerator(); try { while (iterator.MoveNext()) { T value = iterator.Current; process(value); } } finally { (iterator as IDisposable)?.Dispose(); } }