public static HashSet <T> ToHashSetPooled <T>(this IEnumerable <T> source) { var hashSet = HashSetPool <T> .New(); foreach (var item in source) { hashSet.Add(item); } return(hashSet); }
public static void Free <T>(this HashSet <T> hashSet) { HashSetPool <T> .Free(hashSet); }