Skip to content

Instantly share code, notes, and snippets.

@kobi
Created July 6, 2011 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kobi/1066881 to your computer and use it in GitHub Desktop.
Save kobi/1066881 to your computer and use it in GitHub Desktop.
List.ForEach on .Net 4, for http://stackoverflow.com/q/6593926/7586
public void ForEach(Action<T> action)
{
if (action == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.match);
}
for (int i = 0; i < this._size; i++)
{
action(this._items[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment