Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Last active January 8, 2019 15:54
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 MartinZikmund/eaabb8e5df046ca244e911d0ecff4ba5 to your computer and use it in GitHub Desktop.
Save MartinZikmund/eaabb8e5df046ca244e911d0ecff4ba5 to your computer and use it in GitHub Desktop.
.NET Core Array.Fill implementation
public static void Fill<T>(T[] array, T value)
{
if (array == null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
}
for (int i = 0; i < array.Length; i++)
{
array[i] = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment