Beispiel #1
0
        public bool MoveNext()
        {
            if (_enums.Count != 0)
            {
                Current = default;
                foreach (var enumerator in _enums)
                {
                    var compareResult = enumerator.Current.CompareTo(Current);
                    if (compareResult == 0)
                    {
                        _toMove.Add(enumerator);
                    }
                    else if (compareResult > 0)
                    {
                        _toMove.ClearFast();
                        Current = enumerator.Current;
                        _toMove.Add(enumerator);
                    }
                }

                foreach (var enumerator in _toMove)
                {
                    if (!enumerator.MoveNext())
                    {
                        _enums.Remove(enumerator);
                    }
                }
                _toMove.ClearFast();

                return(true);
            }
            _toMove.Clear();
            return(false);
        }
Beispiel #2
0
        public bool MoveNext()
        {
            if (_enums.Count != 0)
            {
                _current = default;
                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <uint> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current > _current)
                    {
                        _current = enumerator.Current;
                    }
                }

                for (int i = 0; i < _enums.Count; i++)
                {
                    ref HList <uint> .Enumerator enumerator = ref _enums.GetByRef(i);
                    if (enumerator.Current == _current && !enumerator.MoveNext())
                    {
                        _enums.Remove(enumerator);
                        i--;//Dirty hack to make list work after removal
                    }
                }