From f76276c7a490a877096b892608d739e317db917e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Lema=C5=84czyk?= Date: Sat, 11 Mar 2023 15:26:39 +0100 Subject: [PATCH] RecyclableArrayList.CopyTo fixed to copy only the no. of items added to the list. --- Recyclable.Collections/RecyclableArrayList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Recyclable.Collections/RecyclableArrayList.cs b/Recyclable.Collections/RecyclableArrayList.cs index 21bd7ce..a559252 100644 --- a/Recyclable.Collections/RecyclableArrayList.cs +++ b/Recyclable.Collections/RecyclableArrayList.cs @@ -302,7 +302,7 @@ namespace Recyclable.Collections public bool Contains(T item) => _memoryBlock.Contains(item); - public void CopyTo(T[] array, int arrayIndex) => _memoryBlock.CopyTo(array, arrayIndex); + public void CopyTo(T[] array, int arrayIndex) => Array.Copy(_memoryBlock, 0, array, arrayIndex, _count); protected static IEnumerable Enumerate(RecyclableArrayList list) {