private static void Remove(ref SelectOptionContext <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 SelectOptionContext <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) { var o = context.selector(context.chained.current.value); while (!o.isSome) { context.chained.skip(ref context.chained.context, out context.chained.current); if (context.chained.current.isSome) { o = context.selector(context.chained.current.value); } else { break; } } next = o; } else { next = new Option <U>(); } if (!next.isSome) { context.bd.Release(); } }
private static void Dispose(ref SelectOptionContext <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); }