Skip to content

Instantly share code, notes, and snippets.

@jackmott
Created March 26, 2017 03:18
Show Gist options
  • Select an option

  • Save jackmott/f674aa4cdcea3fb889f6e12247e108c3 to your computer and use it in GitHub Desktop.

Select an option

Save jackmott/f674aa4cdcea3fb889f6e12247e108c3 to your computer and use it in GitHub Desktop.
fast foreach
public static void ForEach<T>(this T[] array, Action<T> lambda)
{
foreach (var x in array)
{
lambda.Invoke(x);
}
}
//use like
Effects.Split(':').ForEach(x => x.ActivateEffect(x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment