private static void Remove(ref AggregateContext <U, 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 Skip(ref AggregateContext <U, 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) { context.acc = context.selector(context.acc, context.chained.current.value); next = new Option <U>(context.acc); } else { next = new Option <U>(); context.bd.Release(); } }
private static void Dispose(ref AggregateContext <U, 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); }