Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AnyAllSearchOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class AnyAllSearchOperator<TInput> : UnaryQueryOperator<TInput, bool>
8{
9 private sealed class AnyAllSearchOperatorEnumerator<TKey> : QueryOperatorEnumerator<bool, int>
10 {
12
14
15 private readonly bool _qualification;
16
17 private readonly int _partitionIndex;
18
20
22
32
33 internal override bool MoveNext(ref bool currentElement, ref int currentKey)
34 {
36 {
37 return false;
38 }
39 TInput currentElement2 = default(TInput);
40 TKey currentKey2 = default(TKey);
42 {
44 currentKey = _partitionIndex;
45 int num = 0;
46 do
47 {
48 if ((num++ & 0x3F) == 0)
49 {
51 }
53 {
54 return false;
55 }
57 {
58 _resultFoundFlag.Value = true;
60 break;
61 }
62 }
64 return true;
65 }
66 return false;
67 }
68
69 protected override void Dispose(bool disposing)
70 {
72 }
73 }
74
76
77 private readonly bool _qualification;
78
79 internal override bool LimitsParallelism => false;
80
87
88 internal bool Aggregate()
89 {
90 using (IEnumerator<bool> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true))
91 {
92 while (enumerator.MoveNext())
93 {
94 if (enumerator.Current == _qualification)
95 {
96 return _qualification;
97 }
98 }
99 }
100 return !_qualification;
101 }
102
103 internal override QueryResults<bool> Open(QuerySettings settings, bool preferStriping)
104 {
107 }
108
120
121 [ExcludeFromCodeCoverage(Justification = "This method should never be called as it is an ending operator with LimitsParallelism=false")]
123 {
124 throw new NotSupportedException();
125 }
126}
override bool MoveNext(ref bool currentElement, ref int currentKey)
AnyAllSearchOperatorEnumerator(QueryOperatorEnumerator< TInput, TKey > source, bool qualification, Func< TInput, bool > predicate, int partitionIndex, Shared< bool > resultFoundFlag, CancellationToken cancellationToken)
AnyAllSearchOperator(IEnumerable< TInput > child, bool qualification, Func< TInput, bool > predicate)
override QueryResults< bool > Open(QuerySettings settings, bool preferStriping)
override void WrapPartitionedStream< TKey >(PartitionedStream< TInput, TKey > inputStream, IPartitionedStreamRecipient< bool > recipient, bool preferStriping, QuerySettings settings)
override IEnumerable< bool > AsSequentialQuery(CancellationToken token)
bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TElement currentElement, [AllowNull] ref TKey currentKey)