From e9a7625d8b263f1a332fef4a08ba1cd8f511eafa Mon Sep 17 00:00:00 2001 From: Damian Day Date: Wed, 27 May 2020 14:53:02 +0100 Subject: [PATCH] Array Copy Added copying without specifying offsets. --- BeefLibs/corlib/src/Array.bf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/BeefLibs/corlib/src/Array.bf b/BeefLibs/corlib/src/Array.bf index 31506673..53625396 100644 --- a/BeefLibs/corlib/src/Array.bf +++ b/BeefLibs/corlib/src/Array.bf @@ -116,6 +116,14 @@ namespace System arr[i] = default(T); } + public static void Copy(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[] arrayFrom, int srcOffset, T2[] arrayTo, int dstOffset, int length) where T : var where T2 : var { if (((Object)arrayTo == (Object)arrayFrom) && (dstOffset > srcOffset))