From a7ab2ab3fe147699c457f7fc46bfded184d313a3 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Mon, 29 Mar 2021 16:23:29 -0400 Subject: [PATCH] refactor: Renaming OrderedDictionary to SortedDictionary for consistency with .Net --- ...dDictionaryTest.cs => IcdSortedDictionaryTest.cs} | 12 ++++++------ ...cdOrderedDictionary.cs => IcdSortedDictionary.cs} | 10 +++++----- ICD.Common.Utils/Collections/PriorityQueue.cs | 4 ++-- ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) rename ICD.Common.Utils.Tests/Collections/{IcdOrderedDictionaryTest.cs => IcdSortedDictionaryTest.cs} (82%) rename ICD.Common.Utils/Collections/{IcdOrderedDictionary.cs => IcdSortedDictionary.cs} (92%) diff --git a/ICD.Common.Utils.Tests/Collections/IcdOrderedDictionaryTest.cs b/ICD.Common.Utils.Tests/Collections/IcdSortedDictionaryTest.cs similarity index 82% rename from ICD.Common.Utils.Tests/Collections/IcdOrderedDictionaryTest.cs rename to ICD.Common.Utils.Tests/Collections/IcdSortedDictionaryTest.cs index 65b6931..eefe84f 100644 --- a/ICD.Common.Utils.Tests/Collections/IcdOrderedDictionaryTest.cs +++ b/ICD.Common.Utils.Tests/Collections/IcdSortedDictionaryTest.cs @@ -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 dict = new IcdOrderedDictionary + IcdSortedDictionary dict = new IcdSortedDictionary { {0, 0}, {1, 10}, @@ -25,7 +25,7 @@ namespace ICD.Common.Utils.Tests.Collections [Test] public void IsReadOnlyTest() { - IcdOrderedDictionary dict = new IcdOrderedDictionary(); + IcdSortedDictionary dict = new IcdSortedDictionary(); Assert.IsFalse(dict.IsReadOnly); } @@ -33,7 +33,7 @@ namespace ICD.Common.Utils.Tests.Collections [Test] public void KeysTest() { - IcdOrderedDictionary dict = new IcdOrderedDictionary + IcdSortedDictionary dict = new IcdSortedDictionary { {0, 0}, {1, 10}, @@ -51,7 +51,7 @@ namespace ICD.Common.Utils.Tests.Collections [Test] public void ValuesTest() { - IcdOrderedDictionary dict = new IcdOrderedDictionary + IcdSortedDictionary dict = new IcdSortedDictionary { {0, 0}, {1, 10}, @@ -70,7 +70,7 @@ namespace ICD.Common.Utils.Tests.Collections public void IndexerTest() { // ReSharper disable UseObjectOrCollectionInitializer - IcdOrderedDictionary dict = new IcdOrderedDictionary(); + IcdSortedDictionary dict = new IcdSortedDictionary(); // ReSharper restore UseObjectOrCollectionInitializer dict[0] = 0; diff --git a/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs b/ICD.Common.Utils/Collections/IcdSortedDictionary.cs similarity index 92% rename from ICD.Common.Utils/Collections/IcdOrderedDictionary.cs rename to ICD.Common.Utils/Collections/IcdSortedDictionary.cs index edaa41c..94da8df 100644 --- a/ICD.Common.Utils/Collections/IcdOrderedDictionary.cs +++ b/ICD.Common.Utils/Collections/IcdSortedDictionary.cs @@ -13,7 +13,7 @@ namespace ICD.Common.Utils.Collections #if !SIMPLSHARP [DebuggerDisplay("Count = {Count}")] #endif - public sealed class IcdOrderedDictionary : IDictionary + public sealed class IcdSortedDictionary : IDictionary { private readonly List m_OrderedKeys; private readonly List m_ValuesOrderedByKey; @@ -52,7 +52,7 @@ namespace ICD.Common.Utils.Collections /// /// Constructor. /// - public IcdOrderedDictionary() + public IcdSortedDictionary() : this(Comparer.Default) { } @@ -61,7 +61,7 @@ namespace ICD.Common.Utils.Collections /// Constructor. /// /// - public IcdOrderedDictionary([NotNull] IComparer comparer) + public IcdSortedDictionary([NotNull] IComparer comparer) : this(comparer, EqualityComparer.Default) { } @@ -71,7 +71,7 @@ namespace ICD.Common.Utils.Collections /// /// /// - public IcdOrderedDictionary([NotNull] IComparer comparer, [NotNull] IEqualityComparer equalityComparer) + public IcdSortedDictionary([NotNull] IComparer comparer, [NotNull] IEqualityComparer equalityComparer) { if (comparer == null) throw new ArgumentNullException("comparer"); @@ -89,7 +89,7 @@ namespace ICD.Common.Utils.Collections /// Constructor. /// /// - public IcdOrderedDictionary([NotNull] IEnumerable> dictionary) + public IcdSortedDictionary([NotNull] IEnumerable> dictionary) : this() { if (dictionary == null) diff --git a/ICD.Common.Utils/Collections/PriorityQueue.cs b/ICD.Common.Utils/Collections/PriorityQueue.cs index d7f9635..5dea416 100644 --- a/ICD.Common.Utils/Collections/PriorityQueue.cs +++ b/ICD.Common.Utils/Collections/PriorityQueue.cs @@ -18,7 +18,7 @@ namespace ICD.Common.Utils.Collections #endif public sealed class PriorityQueue : IEnumerable, ICollection { - private readonly IcdOrderedDictionary> m_PriorityToQueue; + private readonly IcdSortedDictionary> m_PriorityToQueue; private int m_Count; #region Properties @@ -46,7 +46,7 @@ namespace ICD.Common.Utils.Collections /// public PriorityQueue() { - m_PriorityToQueue = new IcdOrderedDictionary>(); + m_PriorityToQueue = new IcdSortedDictionary>(); } #region Methods diff --git a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj index 6f1653f..0dae781 100644 --- a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj +++ b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj @@ -80,7 +80,7 @@ - +