Fixed handling of empty lists in RecyclableArrayList.
Some RecyclableList properties made public to allow use in RecyclableArrayList. Added support for RecyclableList in RecyclableArrayList.AddRange. Additional tests added for RecyclableArrayList.
This commit is contained in:
1 parent
e312accfe5
commit
e6224ebe44
3 files changed
+209
-123
No files matched your search
@@ -22,6 +22,9 @@ namespace Recyclable.Collections
|
||||
protected ArrayPool<T> _blockArrayPool;
|
||||
protected T[][] _memoryBlocks;
|
||||
|
||||
public int BlockSize => _blockSize;
|
||||
public int BlockCount => _memoryBlocks.Length;
|
||||
|
||||
private long _capacity;
|
||||
public long Capacity
|
||||
{
|
||||
@@ -29,7 +32,8 @@ namespace Recyclable.Collections
|
||||
protected set => _capacity = value;
|
||||
}
|
||||
|
||||
public int Count => (int)_longCount;
|
||||
public int Count => checked((int)_longCount);
|
||||
public bool IsReadOnly { get; }
|
||||
|
||||
protected long _longCount;
|
||||
|
||||
@@ -39,8 +43,8 @@ namespace Recyclable.Collections
|
||||
set => _longCount = value;
|
||||
}
|
||||
|
||||
public bool IsReadOnly { get; }
|
||||
public int BlockCount => _memoryBlocks.Length;
|
||||
public int LastBlockIndex => _lastBlockIndex;
|
||||
public int NextItemIndex => _nextItemIndex;
|
||||
|
||||
private static void RemoveAt(RecyclableList<T> list, long index, ArrayPool<T> blockArrayPool)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user