コード例 #1
0
ファイル: Join.cs プロジェクト: kevin-montrose/LinqAF
        public bool MoveNext()
        {
            if (InnerLookup.IsDefaultValue())
            {
                InnerLookup = CommonImplementation.ToLookupImpl(ref Right, RightKeySelector);
            }

continueYielding:
            if (!NeedsYield.IsDefaultValue())
            {
                if (NeedsYield.MoveNext())
                {
                    var rightCur = NeedsYield.Current;
                    Current = ResultSelector(CurrentKey, rightCur);
                    return(true);
                }

                NeedsYield.Dispose();
                NeedsYield = default(GroupingEnumerator <TRightItem>);
            }

            while (Left.MoveNext())
            {
                var cur    = Left.Current;
                var curKey = LeftKeySelector(cur);

                if (curKey == null)
                {
                    continue;
                }

                CurrentKey = cur;
                NeedsYield = InnerLookup[curKey].GetEnumerator();
                goto continueYielding;
            }

            return(false);
        }
コード例 #2
0
 public void Dispose()
 {
     Inner.Dispose();
 }