From 17703618d4843ce3d379037240c577f4ab48c754 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 15 Jul 2023 15:52:44 +0200 Subject: [PATCH] Tiny performance improvements. Property replaced with field. --- Recyclable.Collections/RecyclableList.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); }