refactor: Renaming OrderedDictionary to SortedDictionary for consistency with .Net

This commit is contained in:
Chris Cameron
2021-03-29 16:23:29 -04:00
parent 370cadbaeb
commit a7ab2ab3fe
4 changed files with 14 additions and 14 deletions

View File

@@ -5,14 +5,14 @@ using NUnit.Framework;
namespace ICD.Common.Utils.Tests.Collections
{
[TestFixture]
public sealed class IcdOrderedDictionaryTest
public sealed class IcdSortedDictionaryTest
{
#region Properties
[Test]
public void CountTest()
{
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
IcdSortedDictionary<int, int> dict = new IcdSortedDictionary<int, int>
{
{0, 0},
{1, 10},
@@ -25,7 +25,7 @@ namespace ICD.Common.Utils.Tests.Collections
[Test]
public void IsReadOnlyTest()
{
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>();
IcdSortedDictionary<int, int> dict = new IcdSortedDictionary<int, int>();
Assert.IsFalse(dict.IsReadOnly);
}
@@ -33,7 +33,7 @@ namespace ICD.Common.Utils.Tests.Collections
[Test]
public void KeysTest()
{
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
IcdSortedDictionary<int, int> dict = new IcdSortedDictionary<int, int>
{
{0, 0},
{1, 10},
@@ -51,7 +51,7 @@ namespace ICD.Common.Utils.Tests.Collections
[Test]
public void ValuesTest()
{
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>
IcdSortedDictionary<int, int> dict = new IcdSortedDictionary<int, int>
{
{0, 0},
{1, 10},
@@ -70,7 +70,7 @@ namespace ICD.Common.Utils.Tests.Collections
public void IndexerTest()
{
// ReSharper disable UseObjectOrCollectionInitializer
IcdOrderedDictionary<int, int> dict = new IcdOrderedDictionary<int, int>();
IcdSortedDictionary<int, int> dict = new IcdSortedDictionary<int, int>();
// ReSharper restore UseObjectOrCollectionInitializer
dict[0] = 0;

View File

@@ -13,7 +13,7 @@ namespace ICD.Common.Utils.Collections
#if !SIMPLSHARP
[DebuggerDisplay("Count = {Count}")]
#endif
public sealed class IcdOrderedDictionary<TKey, TValue> : IDictionary<TKey, TValue>
public sealed class IcdSortedDictionary<TKey, TValue> : IDictionary<TKey, TValue>
{
private readonly List<TKey> m_OrderedKeys;
private readonly List<TValue> m_ValuesOrderedByKey;
@@ -52,7 +52,7 @@ namespace ICD.Common.Utils.Collections
/// <summary>
/// Constructor.
/// </summary>
public IcdOrderedDictionary()
public IcdSortedDictionary()
: this(Comparer<TKey>.Default)
{
}
@@ -61,7 +61,7 @@ namespace ICD.Common.Utils.Collections
/// Constructor.
/// </summary>
/// <param name="comparer"></param>
public IcdOrderedDictionary([NotNull] IComparer<TKey> comparer)
public IcdSortedDictionary([NotNull] IComparer<TKey> comparer)
: this(comparer, EqualityComparer<TKey>.Default)
{
}
@@ -71,7 +71,7 @@ namespace ICD.Common.Utils.Collections
/// </summary>
/// <param name="comparer"></param>
/// <param name="equalityComparer"></param>
public IcdOrderedDictionary([NotNull] IComparer<TKey> comparer, [NotNull] IEqualityComparer<TKey> equalityComparer)
public IcdSortedDictionary([NotNull] IComparer<TKey> comparer, [NotNull] IEqualityComparer<TKey> equalityComparer)
{
if (comparer == null)
throw new ArgumentNullException("comparer");
@@ -89,7 +89,7 @@ namespace ICD.Common.Utils.Collections
/// Constructor.
/// </summary>
/// <param name="dictionary"></param>
public IcdOrderedDictionary([NotNull] IEnumerable<KeyValuePair<TKey, TValue>> dictionary)
public IcdSortedDictionary([NotNull] IEnumerable<KeyValuePair<TKey, TValue>> dictionary)
: this()
{
if (dictionary == null)

View File

@@ -18,7 +18,7 @@ namespace ICD.Common.Utils.Collections
#endif
public sealed class PriorityQueue<T> : IEnumerable<T>, ICollection
{
private readonly IcdOrderedDictionary<int, List<T>> m_PriorityToQueue;
private readonly IcdSortedDictionary<int, List<T>> m_PriorityToQueue;
private int m_Count;
#region Properties
@@ -46,7 +46,7 @@ namespace ICD.Common.Utils.Collections
/// </summary>
public PriorityQueue()
{
m_PriorityToQueue = new IcdOrderedDictionary<int, List<T>>();
m_PriorityToQueue = new IcdSortedDictionary<int, List<T>>();
}
#region Methods

View File

@@ -80,7 +80,7 @@
<Compile Include="Attributes\IIcdAttribute.cs" />
<Compile Include="Attributes\RangeAttribute.cs" />
<Compile Include="Collections\BiDictionary.cs" />
<Compile Include="Collections\IcdOrderedDictionary.cs" />
<Compile Include="Collections\IcdSortedDictionary.cs" />
<Compile Include="Collections\INotifyCollectionChanged.cs" />
<Compile Include="Collections\PriorityQueue.cs" />
<Compile Include="Collections\RateLimitedEventQueue.cs" />