mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-08 01:05:01 +00:00
Merge branch 'IcdHashsetExt' of Common/Utils into dev
This commit is contained in:
@@ -710,6 +710,24 @@ namespace ICD.Common.Utils.Extensions
|
||||
return new IcdHashSet<T>(extends);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the sequence as a IcdHashSet.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="extends"></param>
|
||||
/// <param name="comparer"></param>
|
||||
/// <returns></returns>
|
||||
public static IcdHashSet<T> ToIcdHashSet<T>(this IEnumerable<T> extends, IEqualityComparer<T> comparer)
|
||||
{
|
||||
if (extends == null)
|
||||
throw new ArgumentNullException("extends");
|
||||
|
||||
if (comparer == null)
|
||||
throw new ArgumentNullException("comparer");
|
||||
|
||||
return new IcdHashSet<T>(comparer, extends);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Optimized ToArray implementation with fewer allocations.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user