|
| 1 | + |
| 2 | +using System; |
| 3 | +using System.Runtime.CompilerServices; |
| 4 | +using StructLinq.SkipWhile; |
| 5 | + |
| 6 | +// ReSharper disable once CheckNamespace |
| 7 | +namespace StructLinq |
| 8 | +{ |
| 9 | + public static partial class StructEnumerable |
| 10 | + { |
| 11 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 12 | + public static RefSkipWhileEnumerable<T, TFunction, TEnumerable, TEnumerator> SkipWhile<T, TFunction, TEnumerable, TEnumerator>(this TEnumerable enumerable, TFunction predicate, |
| 13 | + Func<TEnumerable, IRefStructEnumerable<T, TEnumerator>> _) |
| 14 | + where TFunction : struct, IInFunction<T, bool> |
| 15 | + where TEnumerator : struct, IRefStructEnumerator<T> |
| 16 | + where TEnumerable : IRefStructEnumerable<T, TEnumerator> |
| 17 | + { |
| 18 | + return new(enumerable, predicate); |
| 19 | + } |
| 20 | + |
| 21 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 22 | + public static RefSkipWhileEnumerable<T, StructInFunction<T, bool>, TEnumerable, TEnumerator> SkipWhile<T, TEnumerable, TEnumerator>(this TEnumerable enumerable, InFunc<T, bool> predicate, |
| 23 | + Func<TEnumerable, IRefStructEnumerable<T, TEnumerator>> _) |
| 24 | + where TEnumerator : struct, IRefStructEnumerator<T> |
| 25 | + where TEnumerable : IRefStructEnumerable<T, TEnumerator> |
| 26 | + { |
| 27 | + return new(enumerable, predicate.ToStruct()); |
| 28 | + } |
| 29 | + |
| 30 | + [MethodImpl(MethodImplOptions.AggressiveInlining)] |
| 31 | + public static RefSkipWhileEnumerable<T, StructInFunction<T, bool>, IRefStructEnumerable<T, TEnumerator>, TEnumerator> SkipWhile<T, TEnumerator>(this IRefStructEnumerable<T, TEnumerator> enumerable, InFunc<T, bool> predicate) |
| 32 | + where TEnumerator : struct, IRefStructEnumerator<T> |
| 33 | + { |
| 34 | + return new(enumerable, predicate.ToStruct()); |
| 35 | + } |
| 36 | + |
| 37 | + } |
| 38 | +} |
0 commit comments