Add ForEach extension method on IEnumerable

This commit is contained in:
2021-12-13 09:46:32 -06:00
parent fe2d276115
commit f2e8a3a288

12
src/Extensions.cs Normal file
View File

@ -0,0 +1,12 @@
namespace aoc2021;
internal static class Extensions
{
public static void ForEach<T>(this IEnumerable<T> enumeration, Action<T> action)
{
foreach (T item in enumeration)
{
action(item);
}
}
}