static public PooledSet <T> Alloc(IEnumerable <T> inSource) { PooledSet <T> set = Alloc(); foreach (var element in inSource) { set.Add(element); } return(set); }
static public PooledSet <T> Alloc() { PooledSet <T> set = null; if (s_Pool.Count > 0) { set = s_Pool.Pop(); } else { set = new PooledSet <T>(); } set.OnAlloc(); return(set); }