diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 31dc4ad..a12819d 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -180,7 +180,7 @@ namespace Recyclable.Collections protected long EnsureCapacity(in long requestedCapacity) { long oldCapacity = _capacity; - ref T[][] memory = ref _memoryBlocks; + T[][] memory = _memoryBlocks; long newCapacity; switch (oldCapacity > 0) @@ -209,6 +209,7 @@ namespace Recyclable.Collections newCapacity = memory.Length * blockSize; _capacity = newCapacity; + _memoryBlocks = memory; return newCapacity; }