Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
WhereQueryOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class WhereQueryOperator<TInputOutput> : UnaryQueryOperator<TInputOutput, TInputOutput>
8{
9 private sealed class WhereQueryOperatorEnumerator<TKey> : QueryOperatorEnumerator<TInputOutput, TKey>
10 {
12
14
16
18
25
26 internal override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, [AllowNull] ref TKey currentKey)
27 {
28 if (_outputLoopCount == null)
29 {
31 }
32 while (_source.MoveNext(ref currentElement, ref currentKey))
33 {
34 if ((_outputLoopCount.Value++ & 0x3F) == 0)
35 {
37 }
39 {
40 return true;
41 }
42 }
43 return false;
44 }
45
46 protected override void Dispose(bool disposing)
47 {
49 }
50 }
51
53
54 internal override bool LimitsParallelism => false;
55
57 : base(child)
58 {
59 SetOrdinalIndexState(base.Child.OrdinalIndexState.Worse(OrdinalIndexState.Increasing));
61 }
62
64 {
66 for (int i = 0; i < inputStream.PartitionCount; i++)
67 {
69 }
71 }
72
78
80 {
81 IEnumerable<TInputOutput> source = CancellableEnumerable.Wrap(base.Child.AsSequentialQuery(token), token);
82 return source.Where(_predicate);
83 }
84}
bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TElement currentElement, [AllowNull] ref TKey currentKey)
override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, [AllowNull] ref TKey currentKey)
readonly QueryOperatorEnumerator< TInputOutput, TKey > _source
WhereQueryOperatorEnumerator(QueryOperatorEnumerator< TInputOutput, TKey > source, Func< TInputOutput, bool > predicate, CancellationToken cancellationToken)
readonly Func< TInputOutput, bool > _predicate
override void WrapPartitionedStream< TKey >(PartitionedStream< TInputOutput, TKey > inputStream, IPartitionedStreamRecipient< TInputOutput > recipient, bool preferStriping, QuerySettings settings)
override QueryResults< TInputOutput > Open(QuerySettings settings, bool preferStriping)
WhereQueryOperator(IEnumerable< TInputOutput > child, Func< TInputOutput, bool > predicate)
override IEnumerable< TInputOutput > AsSequentialQuery(CancellationToken token)