Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
IntersectQueryOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class IntersectQueryOperator<TInputOutput> : BinaryQueryOperator<TInputOutput, TInputOutput, TInputOutput>
8{
9 private sealed class IntersectQueryOperatorEnumerator<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 OrderedIntersectQueryOperatorEnumerator<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 int num = 0;
99 if (_hashLookup == null)
100 {
103 TLeftKey currentKey2 = default(TLeftKey);
105 {
106 if ((num++ & 0x3F) == 0)
107 {
109 }
112 {
114 }
115 }
116 }
118 int currentKey3 = 0;
120 {
121 if ((num++ & 0x3F) == 0)
122 {
124 }
127 {
128 currentElement = value2.First;
129 currentKey = value2.Second;
131 return true;
132 }
133 }
134 return false;
135 }
136
137 protected override void Dispose(bool disposing)
138 {
139 _leftSource.Dispose();
140 _rightSource.Dispose();
141 }
142 }
143
145
146 internal override bool LimitsParallelism => false;
147
149 : base(left, right)
150 {
152 _outputOrdered = base.LeftChild.OutputOrdered;
154 }
155
157 {
158 QueryResults<TInputOutput> leftChildQueryResults = base.LeftChild.Open(settings, preferStriping: false);
159 QueryResults<TInputOutput> rightChildQueryResults = base.RightChild.Open(settings, preferStriping: false);
161 }
162
174
193
195 {
196 IEnumerable<TInputOutput> first = CancellableEnumerable.Wrap(base.LeftChild.AsSequentialQuery(token), token);
197 IEnumerable<TInputOutput> second = CancellableEnumerable.Wrap(base.RightChild.AsSequentialQuery(token), token);
198 return first.Intersect(second, _comparer);
199 }
200}
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void ICollection< T >. Add(T item)
Definition HashSet.cs:225
override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, ref int currentKey)
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > _leftSource
IntersectQueryOperatorEnumerator(QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftSource, QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > rightSource, IEqualityComparer< TInputOutput > comparer, CancellationToken cancellationToken)
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > _rightSource
OrderedIntersectQueryOperatorEnumerator(QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftSource, QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > rightSource, IEqualityComparer< TInputOutput > comparer, IComparer< TLeftKey > leftKeyComparer, CancellationToken cancellationToken)
override bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TInputOutput currentElement, [AllowNull] ref TLeftKey currentKey)
Dictionary< Wrapper< TInputOutput >, Pair< TInputOutput, TLeftKey > > _hashLookup
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, int > _rightSource
readonly QueryOperatorEnumerator< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > _leftSource
readonly IEqualityComparer< TInputOutput > _comparer
override QueryResults< TInputOutput > Open(QuerySettings settings, bool preferStriping)
IntersectQueryOperator(ParallelQuery< TInputOutput > left, ParallelQuery< TInputOutput > right, IEqualityComparer< TInputOutput > comparer)
override IEnumerable< TInputOutput > AsSequentialQuery(CancellationToken token)
override void WrapPartitionedStream< TLeftKey, TRightKey >(PartitionedStream< TInputOutput, TLeftKey > leftPartitionedStream, PartitionedStream< TInputOutput, TRightKey > rightPartitionedStream, IPartitionedStreamRecipient< TInputOutput > outputRecipient, bool preferStriping, QuerySettings settings)
void WrapPartitionedStreamHelper< TLeftKey, TRightKey >(PartitionedStream< Pair< TInputOutput, NoKeyMemoizationRequired >, TLeftKey > leftHashStream, PartitionedStream< TInputOutput, TRightKey > rightPartitionedStream, IPartitionedStreamRecipient< TInputOutput > outputRecipient, CancellationToken cancellationToken)