Support for custom boundaries implemented. v1 - will be reverted due to 5x slower performance.

This commit is contained in:
mlemanczyk committed 2023-09-17 13:12:16 +02:00
1 parent 1ded5de37a
commit 22d8593e1f
12 files changed
+192 -92

No files matched your search

@@ -27,18 +27,18 @@ namespace Recyclable.Collections
object? IList.this[int index]
{
get => _memoryBlock[index];
get => _memoryBlock.GetValue(index);
set
{
if (value is T typedValue)
{
new Span<T>(_memoryBlock)[index] = typedValue;
_memoryBlock.SetValue(typedValue, index);
}
else if (value == null && _defaultIsNull)
{
#nullable disable
new Span<T>(_memoryBlock)[index] = default;
_memoryBlock.SetValue(default, index);
#nullable restore
}
else