Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SingleQueryOperator.cs
Go to the documentation of this file.
4
6
7internal sealed class SingleQueryOperator<TSource> : UnaryQueryOperator<TSource, TSource>
8{
9 private sealed class SingleQueryOperatorEnumerator<TKey> : QueryOperatorEnumerator<TSource, int>
10 {
12
14
15 private bool _alreadySearched;
16
17 private bool _yieldExtra;
18
20
27
28 internal override bool MoveNext([AllowNull] ref TSource currentElement, ref int currentKey)
29 {
31 {
32 if (_yieldExtra)
33 {
34 _yieldExtra = false;
35 currentElement = default(TSource);
36 currentKey = 0;
37 return true;
38 }
39 return false;
40 }
41 bool flag = false;
42 TSource currentElement2 = default(TSource);
43 TKey currentKey2 = default(TKey);
45 {
47 {
50 currentKey = 0;
51 if (flag)
52 {
53 _yieldExtra = true;
54 break;
55 }
56 flag = true;
57 }
59 {
60 break;
61 }
62 }
63 _alreadySearched = true;
64 return flag;
65 }
66
67 protected override void Dispose(bool disposing)
68 {
70 }
71 }
72
74
75 internal override bool LimitsParallelism => false;
76
82
83 internal override QueryResults<TSource> Open(QuerySettings settings, bool preferStriping)
84 {
85 QueryResults<TSource> childQueryResults = base.Child.Open(settings, preferStriping: false);
87 }
88
100
101 [ExcludeFromCodeCoverage(Justification = "This method should never be called as it is an ending operator with LimitsParallelism=false")]
103 {
104 throw new NotSupportedException();
105 }
106}
bool MoveNext([MaybeNullWhen(false)][AllowNull] ref TElement currentElement, [AllowNull] ref TKey currentKey)
override bool MoveNext([AllowNull] ref TSource currentElement, ref int currentKey)
SingleQueryOperatorEnumerator(QueryOperatorEnumerator< TSource, TKey > source, Func< TSource, bool > predicate, Shared< int > totalElementCount)
SingleQueryOperator(IEnumerable< TSource > child, Func< TSource, bool > predicate)
readonly Func< TSource, bool > _predicate
override QueryResults< TSource > Open(QuerySettings settings, bool preferStriping)
override void WrapPartitionedStream< TKey >(PartitionedStream< TSource, TKey > inputStream, IPartitionedStreamRecipient< TSource > recipient, bool preferStriping, QuerySettings settings)
override IEnumerable< TSource > AsSequentialQuery(CancellationToken token)
static int Increment(ref int location)
static bool Read(ref bool location)
Definition Volatile.cs:67