From 998cdfae4c59a372ad909131885d322dc8012ef8 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Thu, 26 Jan 2023 10:55:45 -0500 Subject: [PATCH] Faster AddRange(Span) --- BeefLibs/corlib/src/Collections/List.bf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BeefLibs/corlib/src/Collections/List.bf b/BeefLibs/corlib/src/Collections/List.bf index 7273c586..f7725e54 100644 --- a/BeefLibs/corlib/src/Collections/List.bf +++ b/BeefLibs/corlib/src/Collections/List.bf @@ -385,8 +385,8 @@ namespace System.Collections Free(oldPtr); return; } - for (var val in ref addSpan) - mItems[mSize++] = val; + Internal.MemCpy(mItems + mSize, addSpan.Ptr, addSpan.Length * alignof(T), alignof(T)); + mSize += (.)addSpan.Length; #if VERSION_LIST mVersion++; #endif