diff --git a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs index 174dc85..1d1269b 100644 --- a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs +++ b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs @@ -710,6 +710,24 @@ namespace ICD.Common.Utils.Extensions return new IcdHashSet(extends); } + /// + /// Returns the sequence as a IcdHashSet. + /// + /// + /// + /// + /// + public static IcdHashSet ToIcdHashSet(this IEnumerable extends, IEqualityComparer comparer) + { + if (extends == null) + throw new ArgumentNullException("extends"); + + if (comparer == null) + throw new ArgumentNullException("comparer"); + + return new IcdHashSet(comparer, extends); + } + /// /// Optimized ToArray implementation with fewer allocations. ///