Bump corefx
[mono.git] / mcs / class / corlib / System / Array.cs
index 8f6e0aa098e40b238d2738503705207086c3eb80..2027b128e93c294abf00fa2b8783463a186e5c79 100644 (file)
@@ -3130,6 +3130,30 @@ namespace System
                        return new ReadOnlyCollection<T> (array);
                }
 
+               public static void Fill<T> (T[] array, T value)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+
+                       for (int i = 0; i < array.Length; i++)
+                               array [i] = value;
+               }
+
+               public static void Fill<T> (T[] array, T value, int startIndex, int count)
+               {
+                       if (array == null)
+                               throw new ArgumentNullException (nameof (array));
+
+                       if (startIndex < 0 || startIndex > array.Length)
+                               throw new ArgumentOutOfRangeException (nameof (startIndex));
+
+                       if (count < 0 || startIndex > array.Length - count)
+                               throw new ArgumentOutOfRangeException (nameof (count));
+
+                       for (int i = startIndex; i < startIndex + count; i++)
+                               array [i] = value;
+               }
+
                public static T Find<T> (T [] array, Predicate<T> match)
                {
                        if (array == null)