Assignments converted to spans

This commit is contained in:
mlemanczyk committed 2023-08-05 00:37:25 +02:00
1 parent 7606bc302c
commit 66364ce4f9
1 file changed
+9 -6
+9 -6
View File
@@ -902,8 +902,9 @@ namespace Recyclable.Collections
if (NeedsClearing) if (NeedsClearing)
{ {
// TODO: Can we benefit from Span<T> here? #nullable disable
_memoryBlocks[_nextItemBlockIndex][_nextItemIndex] = default; new Span<T>(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default;
#nullable restore
} }
_version++; _version++;
@@ -971,8 +972,9 @@ namespace Recyclable.Collections
if (NeedsClearing) if (NeedsClearing)
{ {
// TODO: Can we benefit from Span<T> here? #nullable disable
_memoryBlocks[_nextItemBlockIndex][_nextItemIndex] = default; new Span<T>(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default;
#nullable restore
} }
_version++; _version++;
@@ -1010,8 +1012,9 @@ namespace Recyclable.Collections
if (NeedsClearing) if (NeedsClearing)
{ {
// TODO: Can we benefit from Span<T> here? #nullable disable
_memoryBlocks[_nextItemBlockIndex][_nextItemIndex] = default; new Span<T>(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = default;
#nullable restore
} }
_version++; _version++;