RecyclableList.RemoveBlock renamed to ReleaseBlock.

RecyclableList.Clear will no longer create new arrays. It will only release the array to the pool & decrease capacity.

Fixed possibly infinite loop in Clear.
This commit is contained in:
mlemanczyk committed 2023-01-22 01:06:21 +01:00
1 parent b3380b1f35
commit 576ac9ccfa
2 files changed
+21 -18

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ namespace Recyclable.Collections
{
var toRemove = List[LongCount - 1];
LongCount--;
if (List.Capacity * _blockSize - LongCount == _blockSize)
if ((List.Capacity * _blockSize) - LongCount == _blockSize)
{
List.RemoveBlock(List.BlockCount - 1);
}