Skip to content

Commit e8d7d5a

Browse files
committed
small performance improvement
1 parent 5299d6c commit e8d7d5a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Shared/_Extensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,7 @@ internal static void Fill<T>(this IList<T> collection, T value)
325325

326326
internal static void Fill<T>(this T[] array, T value)
327327
{
328-
for (int i = 0; i < array.Length; ++i)
329-
{
330-
array[i] = value;
331-
}
328+
array.AsSpan().Fill(value);
332329
}
333330

334331
internal static IReadOnlyList<T> EnsureList<T>(this IEnumerable<T> collection)

0 commit comments

Comments
 (0)