diff --git a/ICD.Common.Utils/Collections/IcdHashSet.cs b/ICD.Common.Utils/Collections/IcdHashSet.cs index 346f084..ec62db7 100644 --- a/ICD.Common.Utils/Collections/IcdHashSet.cs +++ b/ICD.Common.Utils/Collections/IcdHashSet.cs @@ -46,8 +46,8 @@ namespace ICD.Common.Utils.Collections /// Constructor. /// public IcdHashSet() + : this(Enumerable.Empty()) { - m_Dict = new Dictionary(); } /// @@ -55,10 +55,33 @@ namespace ICD.Common.Utils.Collections /// /// public IcdHashSet(IEnumerable items) - : this() + : this(EqualityComparer.Default, items) { + } + + /// + /// Constructor. + /// + /// + public IcdHashSet(IEqualityComparer comparer) + : this(comparer, Enumerable.Empty()) + { + } + + /// + /// Constructor. + /// + /// + /// + public IcdHashSet(IEqualityComparer comparer, IEnumerable items) + { + if (comparer == null) + throw new ArgumentNullException("comparer"); + if (items == null) - return; + throw new ArgumentNullException("items"); + + m_Dict = new Dictionary(comparer); AddRange(items); }