Skip to content

Commit

Permalink
remove Enumerable.Repeat
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze committed Jun 19, 2021
1 parent 5168dab commit 535878e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libraries/System.Runtime/tests/System/ArrayTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4278,15 +4278,15 @@ public static void Fill_Casting()
{
Bar[] barArray1 = CreateBarArray();
Array.Fill<object>(barArray1, new Bar() { Value = "x" });
Assert.Equal(Enumerable.Repeat("x", barArray1.Length), barArray1.Select(e => e.Value));
Assert.Equal(new string[] { 'x', 'x', 'x', 'x' }), barArray1.Select(e => e.Value));

Bar[] barArray2 = CreateBarArray();
Array.Fill<object>(barArray2, new Bar() { Value = "x" }, 1, 2);
Assert.Equal(new string[] { "0", "x", "x", "3" }, barArray2.Select(e => e.Value));

uint[] uintArray1 = (uint[])(object)CreateInt32Array();
Array.Fill<uint>(uintArray1, 42);
Assert.Equal(Enumerable.Repeat(42, uintArray1.Length), uintArray1);
Assert.Equal(new int[] { 42, 42, 42, 42 }, uintArray1);

uint[] uintArray2 = (uint[])(object)CreateInt32Array();
Array.Fill<uint>(uintArray2, 42, 1, 2);
Expand Down

0 comments on commit 535878e

Please sign in to comment.