Last active
January 8, 2019 15:54
-
-
Save MartinZikmund/eaabb8e5df046ca244e911d0ecff4ba5 to your computer and use it in GitHub Desktop.
.NET Core Array.Fill implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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