Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ContainsSearchOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class ContainsSearchOperator<TInput> : UnaryQueryOperator<TInput, bool>
8{
9 private sealed class ContainsSearchOperatorEnumerator<TKey> : QueryOperatorEnumerator<bool, int>
10 {
12
13 private readonly TInput _searchValue;
14
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 {
43 currentElement = false;
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;
59 currentElement = 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
75 private readonly TInput _searchValue;
76
78
79 internal override bool LimitsParallelism => false;
80
82 : base(child)
83 {
85 if (comparer == null)
86 {
88 }
89 else
90 {
92 }
93 }
94
95 internal bool Aggregate()
96 {
97 using (IEnumerator<bool> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true))
98 {
99 while (enumerator.MoveNext())
100 {
101 if (enumerator.Current)
102 {
103 return true;
104 }
105 }
106 }
107 return false;
108 }
109
110 internal override QueryResults<bool> Open(QuerySettings settings, bool preferStriping)
111 {
114 }
115
127
128 [ExcludeFromCodeCoverage(Justification = "This method should never be called as it is an ending operator with LimitsParallelism=false")]
130 {
131 throw new NotSupportedException();
132 }
133}
override bool MoveNext(ref bool currentElement, ref int currentKey)
ContainsSearchOperatorEnumerator(QueryOperatorEnumerator< TInput, TKey > source, TInput searchValue, IEqualityComparer< TInput > comparer, int partitionIndex, Shared< bool > resultFoundFlag, CancellationToken cancellationToken)
ContainsSearchOperator(IEnumerable< TInput > child, TInput searchValue, IEqualityComparer< TInput > comparer)
override QueryResults< bool > Open(QuerySettings settings, bool preferStriping)
override void WrapPartitionedStream< TKey >(PartitionedStream< TInput, TKey > inputStream, IPartitionedStreamRecipient< bool > recipient, bool preferStriping, QuerySettings settings)
readonly IEqualityComparer< TInput > _comparer
override IEnumerable< bool > AsSequentialQuery(CancellationToken token)
bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TElement currentElement, [AllowNull] ref TKey currentKey)