From 80756aff442519fc39f79e6a950f3c2acfccc517 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 1 Apr 2023 20:00:32 +0200 Subject: [PATCH] RecyclableList.RemoveAt fix to release the rented block correctly. --- Recyclable.Collections/RecyclableList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index b774002..3967338 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -69,7 +69,7 @@ namespace Recyclable.Collections list._nextItemIndex = blockSize; } - if ((list._capacity * blockSize) - oldCountMinus1 == blockSize) + if (list._capacity - oldCountMinus1 == blockSize) { T[][] memoryBlocks = list._memoryBlocks; if (blockSize >= RecyclableDefaults.MinPooledArrayLength)