private static void Skip(ref GroupJoinContext <U, K, T2, T, C> context, out Option <U> next) { context.bd.DetectBacktrack(); if (context.needsMove) { context.chained.skip(ref context.chained.context, out context.chained.current); } else { context.needsMove = true; } if (context.chained.current.isSome) { var bd = BacktrackDetector.Borrow(); next = new Option <U>(context.resultSelector( context.chained.current.value, context.lookup.GetValues(context.outerSelector(context.chained.current.value)).SlinqAndKeep(bd))); bd.TryReleaseShared(); } else { next = new Option <U>(); context.bd.Release(); if (context.release) { context.lookup.DisposeInBackground(); } } }
private static void Remove(ref GroupJoinContext <U, K, T2, T, C> context, out Option <U> next) { context.bd.DetectBacktrack(); context.needsMove = false; context.chained.remove(ref context.chained.context, out context.chained.current); Skip(ref context, out next); }
private static void Dispose(ref GroupJoinContext <U, K, T2, T, C> context, out Option <U> next) { next = new Option <U>(); context.bd.Release(); context.chained.dispose(ref context.chained.context, out context.chained.current); if (context.release) { context.lookup.DisposeInBackground(); } }