Files
speckle-sharp-connectors/Sdk/Speckle.Connectors.Common/Extensions/CollectionExtensions.cs
T
Adam Hathcock 332ab25e64 Use Sets and Freezing to make conversions faster (#430)
* Use Sets and Freezing to make conversions faster

* fmt

* move class to own file
2024-12-03 13:32:27 +00:00

21 lines
419 B
C#

namespace Speckle.Connectors.Common.Extensions;
public static class CollectionExtensions
{
public static void AddRange<T>(this ICollection<T> collection, IEnumerable<T> items)
{
foreach (var item in items)
{
collection.Add(item);
}
}
#if NETSTANDARD2_0
public static HashSet<T> ToHashSet<T>(this IEnumerable<T> items)
{
var set = new HashSet<T>(items);
return set;
}
#endif
}