public MemoryBlocks property added to allow more efficient use.
This commit is contained in:
1 parent
c283cb562c
commit
4fcf3f2362
1 file changed
+3
-1
@@ -14,7 +14,7 @@ namespace Recyclable.Collections
|
|||||||
|
|
||||||
private int _blockSize;
|
private int _blockSize;
|
||||||
private int _lastBlockIndex;
|
private int _lastBlockIndex;
|
||||||
private int _lastItemIndex;
|
private int _lastItemIndex;
|
||||||
protected T[][] _memoryBlocks;
|
protected T[][] _memoryBlocks;
|
||||||
|
|
||||||
private long _capacity;
|
private long _capacity;
|
||||||
@@ -270,6 +270,8 @@ namespace Recyclable.Collections
|
|||||||
set => new Span<T>(_memoryBlocks[index / _blockSize])[index % _blockSize] = value;
|
set => new Span<T>(_memoryBlocks[index / _blockSize])[index % _blockSize] = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public T[][] MemoryBlocks { get => _memoryBlocks; }
|
||||||
|
|
||||||
public void Add(T item)
|
public void Add(T item)
|
||||||
{
|
{
|
||||||
long requiredCapacity = _longCount + 1;
|
long requiredCapacity = _longCount + 1;
|
||||||
|
|||||||
Reference in new issue
Block a user