Пример #1
0
            public IEnumerator <TElement> GetEnumerator()
            {
                Buffer <TElement> buffer = new Buffer <TElement>(source);

                if (buffer.count > 0)
                {
                    EnumerableSorter <TElement> sorter = GetEnumerableSorter(null);
                    int[] map = sorter.Sort(buffer.items, buffer.count);
                    sorter = null;
                    for (int i = 0; i < buffer.count; i++)
                    {
                        yield return(buffer.items[map[i]]);
                    }
                }
            }
Пример #2
0
        public IEnumerator <TElement> GetEnumerator()
        {
            Buffer <TElement> buffer = new Buffer <TElement>(this.source);

            if (buffer.count > 0)
            {
                EnumerableSorter <TElement> enumerableSorter = this.GetEnumerableSorter(null);
                int[] array = enumerableSorter.Sort(buffer.items, buffer.count);
                enumerableSorter = null;
                for (int i = 0; i < buffer.count; i++)
                {
                    yield return(buffer.items[array[i]]);
                }
            }
            yield break;
        }