Skip to content

Commit

Permalink
Use Span(T[]? array) ctor
Browse files Browse the repository at this point in the history
  • Loading branch information
xtqqczze committed Jun 18, 2021
1 parent f261e92 commit 07dd088
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libraries/System.Private.CoreLib/src/System/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,7 @@ public static void Fill<T>(T[] array, T value)
}
else
{
var span = new Span<T>(ref MemoryMarshal.GetArrayDataReference(array), array.Length);
span.Fill(value);
new Span<T>(array).Fill(value);
}
}

Expand Down

0 comments on commit 07dd088

Please sign in to comment.