From 853a69fa4d41acaf638f2f83ec062cdb142a2a72 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Thu, 25 May 2023 19:01:25 +0200 Subject: [PATCH] Tiny cleanup --- Recyclable.Collections/RecyclableList.cs | 38 ++++++++++++------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index c9b3c7e..19937d3 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -350,26 +350,26 @@ namespace Recyclable.Collections if (enumerator.MoveNext()) { int available = capacity - targetItemIdx; - do - { - if (targetItemIdx + growByCount > capacity) - { - capacity = EnsureCapacity(this, capacity + growByCount); - memorySpan = new(_memoryBlock); - available = capacity - targetItemIdx; - } + do + { + if (targetItemIdx + growByCount > capacity) + { + capacity = EnsureCapacity(this, capacity + growByCount); + memorySpan = new(_memoryBlock); + available = capacity - targetItemIdx; + } - for (i = 0; i < available; i++) - { - memorySpan[targetItemIdx++] = enumerator.Current; - if (!enumerator.MoveNext()) - { - break; - } - } - } - while (i >= available); - } + for (i = 0; i < available; i++) + { + memorySpan[targetItemIdx++] = enumerator.Current; + if (!enumerator.MoveNext()) + { + break; + } + } + } + while (i >= available); + } _count = targetItemIdx; }