From d4440134c86fbebd83e1b7600ba54475aa0ba842 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Fri, 27 Jan 2023 23:32:28 +0100 Subject: [PATCH] `ref` removed. I seem to get better & more stable benchmarks without it. --- Recyclable.Collections/RecyclableList.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }