Skip to content

Commit

Permalink
Use Array.Fill in Enumerable.Repeat.ToArray (dotnet/corefx#16122)
Browse files Browse the repository at this point in the history
* Use Array.Fill in Enumerable.Repeat.ToArray


Commit migrated from dotnet/corefx@28ffdd6
  • Loading branch information
jamesqo authored and stephentoub committed Feb 13, 2017
1 parent 8b3d178 commit a84f181
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/libraries/System.Linq/src/System/Linq/Repeat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,7 @@ public TResult[] ToArray()
TResult[] array = new TResult[_count];
if (_current != null)
{
for (int i = 0; i != array.Length; ++i)
{
array[i] = _current;
}
Array.Fill(array, _current);
}

return array;
Expand Down

0 comments on commit a84f181

Please sign in to comment.