Esempio n. 1
0
 /// <summary>
 ///     The first element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut Last <TOut, TProducer>(
     this SpanEnumerable <TOut, TProducer> spanEnum,
     Predicate <TOut> predicate)
     where TProducer : struct, IProducer <TOut>
 =>
 spanEnum.Where(predicate).Last();
Esempio n. 2
0
 /// <summary>
 ///     The first element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut FirstOrDefault <TOut, TProducer>(
     this SpanEnumerable <TOut, TProducer> spanEnum,
     Predicate <TOut> predicate)
     where TProducer : struct, IProducer <TOut>
 =>
 spanEnum.Where(predicate).FirstOrDefault();
Esempio n. 3
0
 /// <summary>
 ///     The last element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut LastOrDefault <TOut>(
     this SpanEnumerable <TOut> spanEnum,
     Predicate <TOut> predicate)
 =>
 spanEnum.Where(predicate).LastOrDefault();
Esempio n. 4
0
 /// <summary>
 ///     The single element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut Single <TIn, TOut, TProducer>(
     this SpanEnumerable <TIn, TOut, TProducer> spanEnum,
     Predicate <TOut> predicate)
     where TProducer : struct, IProducer <TIn, TOut>
 =>
 spanEnum.Where(predicate).Single();
Esempio n. 5
0
 /// <summary>
 ///     The first element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut First <TOut>(
     this SpanEnumerable <TOut> spanEnum,
     Predicate <TOut> predicate)
 =>
 spanEnum.Where(predicate).First();
Esempio n. 6
0
 /// <summary>
 ///     The single element of a sequence that satisfies a predicate.
 /// </summary>
 public static TOut Single <TOut>(
     this SpanEnumerable <TOut> spanEnum,
     Predicate <TOut> predicate)
 =>
 spanEnum.Where(predicate).Single();