public IList <Format> Split(char search, int maxCount) { var splits = FindAll(search, maxCount); var sl = SplitListPool.Get(this, splits); // Keep track of the split lists we create so that they can be returned for reuse in the future. m_Splits.Add(sl); return(sl); }
public void ReleaseToPool() { Clear(); foreach (var i in Items) { // Only release items we own if (ReferenceEquals(this, i.Parent)) { FormatItemPool.Release(i); } } foreach (var s in m_Splits) { SplitListPool.Release(s); } parent = null; Items.Clear(); HasNested = false; splitCache = null; m_Splits.Clear(); }