Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExceptQueryOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class ExceptQueryOperator<TInputOutput> : BinaryQueryOperator<TInputOutput, TInputOutput, TInputOutput>
8{
9 private sealed class ExceptQueryOperatorEnumerator<TLeftKey> : QueryOperatorEnumerator<TInputOutput, int>
10 {
12
14
16
18
20
22
30
31 internal override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, ref int currentKey)
32 {
33 if (_hashLookup == null)
34 {
38 int currentKey2 = 0;
39 int num = 0;
41 {
42 if ((num++ & 0x3F) == 0)
43 {
45 }
47 }
48 }
50 TLeftKey currentKey3 = default(TLeftKey);
52 {
53 if ((_outputLoopCount.Value++ & 0x3F) == 0)
54 {
56 }
58 {
60 return true;
61 }
62 }
63 return false;
64 }
65
66 protected override void Dispose(bool disposing)
67 {
68 _leftSource.Dispose();
69 _rightSource.Dispose();
70 }
71 }
72
73 private sealed class OrderedExceptQueryOperatorEnumerator<TLeftKey> : QueryOperatorEnumerator<TInputOutput, TLeftKey>
74 {
76
78
80
82
84
86
95
96 internal override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, [AllowNull] ref TLeftKey currentKey)
97 {
98 if (_outputEnumerator == null)
99 {
102 int currentKey2 = 0;
103 int num = 0;
105 {
106 if ((num++ & 0x3F) == 0)
107 {
109 }
111 }
114 TLeftKey currentKey3 = default(TLeftKey);
116 {
117 if ((num++ & 0x3F) == 0)
118 {
120 }
121 if (!hashSet.Contains(currentElement3.First))
122 {
124 if (!dictionary.TryGetValue(key, out var value) || _leftKeyComparer.Compare(currentKey3, value.Second) < 0)
125 {
127 }
128 }
129 }
131 }
132 if (_outputEnumerator.MoveNext())
133 {
135 currentElement = value2.First;
136 currentKey = value2.Second;
137 return true;
138 }
139 return false;
140 }
141
142 protected override void Dispose(bool disposing)
143 {
144 _leftSource.Dispose();
145 _rightSource.Dispose();
146 }
147 }
148
150
151 internal override bool LimitsParallelism => false;
152
154 : base(left, right)
155 {
157 _outputOrdered = base.LeftChild.OutputOrdered;
159 }
160
162 {
163 QueryResults<TInputOutput> leftChildQueryResults = base.LeftChild.Open(settings, preferStriping: false);
164 QueryResults<TInputOutput> rightChildQueryResults = base.RightChild.Open(settings, preferStriping: false);
166 }
167
179
198
200 {
201 IEnumerable<TInputOutput> first = CancellableEnumerable.Wrap(base.LeftChild.AsSequentialQuery(token), token);
202 IEnumerable<TInputOutput> second = CancellableEnumerable.Wrap(base.RightChild.AsSequentialQuery(token), token);
203 return first.Except(second, _comparer);
204 }
205}
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
void Add(TKey key, TValue value)
void ICollection< T >. Add(T item)
Definition HashSet.cs:225
ExceptQueryOperatorEnumerator(QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftSource, QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > rightSource, IEqualityComparer< TInputOutput > comparer, CancellationToken cancellationToken)
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > _rightSource
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > _leftSource
override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, ref int currentKey)
override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, [AllowNull] ref TLeftKey currentKey)
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > _leftSource
OrderedExceptQueryOperatorEnumerator(QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftSource, QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > rightSource, IEqualityComparer< TInputOutput > comparer, IComparer< TLeftKey > leftKeyComparer, CancellationToken cancellationToken)
IEnumerator< KeyValuePair< Wrapper< TInputOutput >, Pair< TInputOutput, TLeftKey > > > _outputEnumerator
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > _rightSource
override IEnumerable< TInputOutput > AsSequentialQuery(CancellationToken token)
override QueryResults< TInputOutput > Open(QuerySettings settings, bool preferStriping)
readonly IEqualityComparer< TInputOutput > _comparer
ExceptQueryOperator(ParallelQuery< TInputOutput > left, ParallelQuery< TInputOutput > right, IEqualityComparer< TInputOutput > comparer)
void WrapPartitionedStreamHelper< TLeftKey, TRightKey >(PartitionedStream< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftHashStream, PartitionedStream< TInputOutput, TRightKey > rightPartitionedStream, IPartitionedStreamRecipient< TInputOutput > outputRecipient, CancellationToken cancellationToken)
override void WrapPartitionedStream< TLeftKey, TRightKey >(PartitionedStream< TInputOutput, TLeftKey > leftStream, PartitionedStream< TInputOutput, TRightKey > rightStream, IPartitionedStreamRecipient< TInputOutput > outputRecipient, bool preferStriping, QuerySettings settings)