diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 910b993..757d923 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -295,19 +295,19 @@ namespace Recyclable.Collections for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) { - itemsSpan = new(items.AsArray[blockIndex], 0, sourceBlockSize); + itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize); itemsSpan.CopyTo(targetSpan); targetSpan = targetSpan[sourceBlockSize..]; } if (blockIndex == 0) { - itemsSpan = new(items.AsArray[blockIndex], 0, (int)sourceItemsCount); + itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount); itemsSpan.CopyTo(targetSpan); } else if (blockIndex <= items.LastBlockWithData) { - itemsSpan = new(items.AsArray[blockIndex], 0, items.NextItemIndex); + itemsSpan = new(items._memoryBlocks[blockIndex], 0, items.NextItemIndex); itemsSpan.CopyTo(targetSpan); }