From 75ad8227c211c88e932be80bf38cc2df5043f020 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 16 Jul 2023 11:52:45 +0200 Subject: [PATCH] Tiny cleanup. Local var renamed to match other places. --- Recyclable.Collections/RecyclableList.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 7818a70..7647f61 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -21,7 +21,7 @@ namespace Recyclable.Collections private IEnumerator AddRangeEnumerated(IEnumerable source, int growByCount) { - int targetItemIdx = _count; + int targetItemIndex = _count; Span memorySpan; int i; @@ -31,19 +31,19 @@ namespace Recyclable.Collections memorySpan = new(_memoryBlock); if (enumerator.MoveNext()) { - int available = capacity - targetItemIdx; + int available = capacity - targetItemIndex; do { - if (targetItemIdx + growByCount > capacity) + if (targetItemIndex + growByCount > capacity) { - capacity = RecyclableListHelpers.ResizeAndCopy(this, checked((int)BitOperations.RoundUpToPowerOf2((uint)(capacity + growByCount)))); + capacity = RecyclableListHelpers.ResizeAndCopy(this, checked((int)BitOperations.RoundUpToPowerOf2((uint)(targetItemIndex + growByCount)))); memorySpan = new(_memoryBlock); - available = capacity - targetItemIdx; + available = capacity - targetItemIndex; } for (i = 0; i < available; i++) { - memorySpan[targetItemIdx++] = enumerator.Current; + memorySpan[targetItemIndex++] = enumerator.Current; if (!enumerator.MoveNext()) { break; @@ -54,7 +54,7 @@ namespace Recyclable.Collections } _capacity = capacity; - _count = targetItemIdx; + _count = targetItemIndex; return enumerator; }