From dd33da0d7cbe56f9e32b981e4f31d28e78d18261 Mon Sep 17 00:00:00 2001 From: Damian Day Date: Wed, 27 May 2020 17:26:35 +0100 Subject: [PATCH] Update Array.bf Remove length parameter. --- BeefLibs/corlib/src/Array.bf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BeefLibs/corlib/src/Array.bf b/BeefLibs/corlib/src/Array.bf index 04c16053..a6dc0e86 100644 --- a/BeefLibs/corlib/src/Array.bf +++ b/BeefLibs/corlib/src/Array.bf @@ -274,12 +274,12 @@ namespace System Internal.MemCpy(destination.Ptr, &GetRef(0), strideof(T) * mLength, alignof(T)); } - public void CopyTo(Span destination, int srcOffset, int length) + public void CopyTo(Span destination, int srcOffset) { - Debug.Assert(length >= 0); - Debug.Assert((uint)srcOffset + (uint)length <= (uint)mLength); - Debug.Assert((uint)length <= (uint)destination.Length); - Internal.MemCpy(destination.Ptr, &GetRef(srcOffset), strideof(T) * length, alignof(T)); + Debug.Assert(destination.Length >= mLength); + Debug.Assert((uint)srcOffset <= (uint)mLength); + + Internal.MemCpy(destination.Ptr, &GetRef(srcOffset), strideof(T) * (mLength - srcOffset), alignof(T)); } public Span.Enumerator GetEnumerator()