Tiny performance improvements. Property replaced with field.

This commit is contained in:
mlemanczyk committed 2023-07-15 15:52:44 +02:00
1 parent ceffb90936
commit 17703618d4
1 file changed
+3 -3
+3 -3
View File
@@ -295,19 +295,19 @@ namespace Recyclable.Collections
for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++) for (blockIndex = 0; blockIndex <= lastBlockIndex; blockIndex++)
{ {
itemsSpan = new(items.AsArray[blockIndex], 0, sourceBlockSize); itemsSpan = new(items._memoryBlocks[blockIndex], 0, sourceBlockSize);
itemsSpan.CopyTo(targetSpan); itemsSpan.CopyTo(targetSpan);
targetSpan = targetSpan[sourceBlockSize..]; targetSpan = targetSpan[sourceBlockSize..];
} }
if (blockIndex == 0) if (blockIndex == 0)
{ {
itemsSpan = new(items.AsArray[blockIndex], 0, (int)sourceItemsCount); itemsSpan = new(items._memoryBlocks[blockIndex], 0, (int)sourceItemsCount);
itemsSpan.CopyTo(targetSpan); itemsSpan.CopyTo(targetSpan);
} }
else if (blockIndex <= items.LastBlockWithData) else if (blockIndex <= items.LastBlockWithData)
{ {
itemsSpan = new(items.AsArray[blockIndex], 0, items.NextItemIndex); itemsSpan = new(items._memoryBlocks[blockIndex], 0, items.NextItemIndex);
itemsSpan.CopyTo(targetSpan); itemsSpan.CopyTo(targetSpan);
} }