예제 #1
0
 public GroupedResultEnumerator Init(
     GroupedResultEnumerable <TSource, TKey, TResult> parent,
     PoolingDictionary <TKey, PoolingGrouping> src)
 {
     _src        = src;
     _parent     = parent;
     _enumerator = _src.GetEnumerator();
     return(this);
 }
예제 #2
0
            public void Dispose()
            {
                // Cleanup contents
                foreach (var grouping in _src)
                {
                    grouping.Value.Dispose();
                    Pool <PoolingGrouping> .Return(grouping.Value);
                }

                // cleanup collection
                _src?.Dispose();
                Pool <PoolingDictionary <TKey, PoolingGrouping> > .Return(_src);

                _src = default;

                _enumerator?.Dispose();
                _enumerator = default;

                _parent?.Dispose();
                _parent = default;

                Pool <GroupedResultEnumerator> .Return(this);
            }