mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-26 19:48:01 +02:00
CopyTo's
This commit is contained in:
parent
9ca36030cd
commit
e8ea4e3b2d
2 changed files with 24 additions and 0 deletions
|
@ -530,6 +530,22 @@ namespace System.Collections
|
|||
span[i] = mItems[i];
|
||||
}
|
||||
|
||||
public void CopyTo(Span<T> array, int arrayIndex)
|
||||
{
|
||||
// Delegate rest of error checking to Array.Copy.
|
||||
for (int i = 0; i < mSize; i++)
|
||||
array[i + arrayIndex] = mItems[i];
|
||||
}
|
||||
|
||||
public void CopyTo(int index, Span<T> array, int arrayIndex, int count)
|
||||
{
|
||||
Debug.Assert((uint)index < (uint)mSize);
|
||||
Debug.Assert((uint)index + (uint)count <= (uint)mSize);
|
||||
// Delegate rest of error checking to Array.Copy.
|
||||
for (int i = 0; i < count; i++)
|
||||
array[i + arrayIndex] = mItems[i + index];
|
||||
}
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex)
|
||||
{
|
||||
// Delegate rest of error checking to Array.Copy.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue