Small performance improvement to benefit from .Net optimization for faster calls.

This commit is contained in:
mlemanczyk committed 2023-07-08 14:28:36 +02:00
1 parent 3f11b3b384
commit 5ee70abf93
1 file changed
+2 -3
+2 -3
View File
@@ -433,9 +433,8 @@ namespace Recyclable.Collections
if (oldCount > 0)
{
var sourceSpan = new Span<T>(_memoryBlock, index, oldCount);
var targetSpan = new Span<T>(_memoryBlock, index + 1, oldCount);
sourceSpan.CopyTo(targetSpan);
new Span<T>(_memoryBlock, index, oldCount)
.CopyTo(new Span<T>(_memoryBlock, index + 1, oldCount));
}
_memoryBlock[index] = item;