Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Use Array.Fill in Enumerable.Repeat.ToArray (#16122)
Browse files Browse the repository at this point in the history
* Use Array.Fill in Enumerable.Repeat.ToArray
  • Loading branch information
jamesqo authored and stephentoub committed Feb 13, 2017
1 parent 0dbacad commit 28ffdd6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/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 28ffdd6

Please sign in to comment.