1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Merge pull request #301 from damianday/Array.Copy

Array Copy
This commit is contained in:
Brian Fiete 2020-05-27 07:09:09 -07:00 committed by GitHub
commit 46cd1c0c76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,6 +116,14 @@ namespace System
arr[i] = default(T);
}
public static void Copy<T, T2>(T[] sourceArray, T2[] destinationArray, int length) where T : var where T2 : var
{
Debug.Assert(sourceArray != null);
Debug.Assert(destinationArray != null);
Copy(sourceArray, 0, destinationArray, 0, length);
}
public static void Copy<T, T2>(T[] arrayFrom, int srcOffset, T2[] arrayTo, int dstOffset, int length) where T : var where T2 : var
{
if (((Object)arrayTo == (Object)arrayFrom) && (dstOffset > srcOffset))