From d4650293584e2a5a481c704e2badfa2a86fb9f11 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 25 Jun 2023 20:16:30 +0200 Subject: [PATCH] RecyclableList.RecyclableListHelpers renamed to RecyclableList.Helpers --- Recyclable.Collections/RecyclableList.Helpers.cs | 2 +- Recyclable.Collections/RecyclableQueue.cs | 14 +++++++------- Recyclable.Collections/RecyclableSortedList.cs | 2 +- Recyclable.CollectionsTests/RecyclableListTests.cs | 2 +- .../RecyclableLongListTests.cs | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Recyclable.Collections/RecyclableList.Helpers.cs b/Recyclable.Collections/RecyclableList.Helpers.cs index a7d8c22..78302d4 100644 --- a/Recyclable.Collections/RecyclableList.Helpers.cs +++ b/Recyclable.Collections/RecyclableList.Helpers.cs @@ -4,7 +4,7 @@ namespace Recyclable.Collections { public partial class RecyclableList { - internal static class RecyclableListHelpers + internal static class Helpers { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Contains(RecyclableList arrays, T item) => arrays.Any(x => x.Contains(item)); diff --git a/Recyclable.Collections/RecyclableQueue.cs b/Recyclable.Collections/RecyclableQueue.cs index b5c8653..2f4c91b 100644 --- a/Recyclable.Collections/RecyclableQueue.cs +++ b/Recyclable.Collections/RecyclableQueue.cs @@ -171,13 +171,13 @@ namespace Recyclable.Collections } } - public bool Contains(T item) => RecyclableList.RecyclableListHelpers.Contains(Memory, item); - public void CopyTo(T[] array, int arrayIndex) => RecyclableList.RecyclableListHelpers.CopyTo(Memory, RemovedCount, BlockSize, (int)(LongCount % BlockSize), array, arrayIndex); - public IEnumerable Enumerate() => RecyclableList.RecyclableListHelpers.Enumerate(Memory, BlockSize, LongCount); - public IEnumerator GetEnumerator() => RecyclableList.RecyclableListHelpers.Enumerate(Memory, BlockSize, LongCount).GetEnumerator(); - IEnumerator IEnumerable.GetEnumerator() => RecyclableList.RecyclableListHelpers.Enumerate(Memory, BlockSize, LongCount).GetEnumerator(); - public int IndexOf(T item) => (int)GetRelativeIndex(RecyclableList.RecyclableListHelpers.LongIndexOf(Memory, BlockSize, item, _equalityComparer)); - public long LongIndexOf(T item) => GetRelativeIndex(RecyclableList.RecyclableListHelpers.LongIndexOf(Memory, BlockSize, item, _equalityComparer)); + public bool Contains(T item) => RecyclableList.Helpers.Contains(Memory, item); + public void CopyTo(T[] array, int arrayIndex) => RecyclableList.Helpers.CopyTo(Memory, RemovedCount, BlockSize, (int)(LongCount % BlockSize), array, arrayIndex); + public IEnumerable Enumerate() => RecyclableList.Helpers.Enumerate(Memory, BlockSize, LongCount); + public IEnumerator GetEnumerator() => RecyclableList.Helpers.Enumerate(Memory, BlockSize, LongCount).GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => RecyclableList.Helpers.Enumerate(Memory, BlockSize, LongCount).GetEnumerator(); + public int IndexOf(T item) => (int)GetRelativeIndex(RecyclableList.Helpers.LongIndexOf(Memory, BlockSize, item, _equalityComparer)); + public long LongIndexOf(T item) => GetRelativeIndex(RecyclableList.Helpers.LongIndexOf(Memory, BlockSize, item, _equalityComparer)); public void Insert(int index, T item) => throw new NotSupportedException(); public void RemoveAt(int index) => throw new NotSupportedException(); public bool TryDequeue(out T? item) => TryDequeue(this, out item); diff --git a/Recyclable.Collections/RecyclableSortedList.cs b/Recyclable.Collections/RecyclableSortedList.cs index 3dfdc20..11968cd 100644 --- a/Recyclable.Collections/RecyclableSortedList.cs +++ b/Recyclable.Collections/RecyclableSortedList.cs @@ -68,7 +68,7 @@ BeginUpdate(); try { - RecyclableList<(TKey Key, TValue Value)>.RecyclableListHelpers.QuickSort(this, _comparer, _randomNumberGenerator); + RecyclableList<(TKey Key, TValue Value)>.Helpers.QuickSort(this, _comparer, _randomNumberGenerator); } finally { diff --git a/Recyclable.CollectionsTests/RecyclableListTests.cs b/Recyclable.CollectionsTests/RecyclableListTests.cs index 2e1a4a5..2ae5f0c 100644 --- a/Recyclable.CollectionsTests/RecyclableListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableListTests.cs @@ -422,7 +422,7 @@ namespace Recyclable.CollectionsTests // Act using RecyclableList list = new(testData); - RecyclableList.RecyclableListHelpers.QuickSort(list); + RecyclableList.Helpers.QuickSort(list); // Validate _ = list.Count.Should().Be((int)itemsCount); diff --git a/Recyclable.CollectionsTests/RecyclableLongListTests.cs b/Recyclable.CollectionsTests/RecyclableLongListTests.cs index 7704e9d..30d091f 100644 --- a/Recyclable.CollectionsTests/RecyclableLongListTests.cs +++ b/Recyclable.CollectionsTests/RecyclableLongListTests.cs @@ -479,7 +479,7 @@ namespace Recyclable.CollectionsTests // Act using RecyclableLongList list = new(testData, minBlockSize: targetBlockSize); - RecyclableList.RecyclableListHelpers.QuickSort(list); + RecyclableList.Helpers.QuickSort(list); // Validate _ = list.LongCount.Should().Be(itemsCount);