Skip to content

Commit 49b1eba

Browse files
committed
Switched a Span<T>.CopyTo to Array.Copy
1 parent 0c79764 commit 49b1eba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.Toolkit.HighPerformance/Extensions/ArrayPoolExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void Resize<T>(this ArrayPool<T> pool, ref T[]? array, int newSize
4646
T[] newArray = pool.Rent(newSize);
4747
int itemsToCopy = Math.Min(array.Length, newSize);
4848

49-
array.AsSpan(0, itemsToCopy).CopyTo(newArray);
49+
Array.Copy(array, 0, newArray, 0, itemsToCopy);
5050

5151
pool.Return(array, clearArray);
5252

0 commit comments

Comments
 (0)