Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NullableLongMinMaxAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class NullableLongMinMaxAggregationOperator : InlinedAggregationOperator<long?, long?, long?>
7{
9 {
11
12 private readonly int _sign;
13
20
21 protected override bool MoveNextCore(ref long? currentElement)
22 {
24 TKey currentKey = default(TKey);
25 if (source.MoveNext(ref currentElement, ref currentKey))
26 {
27 int num = 0;
28 if (_sign == -1)
29 {
30 long? currentElement2 = null;
31 while (source.MoveNext(ref currentElement2, ref currentKey))
32 {
33 if ((num++ & 0x3F) == 0)
34 {
36 }
38 {
40 }
41 }
42 }
43 else
44 {
45 long? currentElement3 = null;
46 while (source.MoveNext(ref currentElement3, ref currentKey))
47 {
48 if ((num++ & 0x3F) == 0)
49 {
51 }
53 {
55 }
56 }
57 }
58 return true;
59 }
60 return false;
61 }
62
63 protected override void Dispose(bool disposing)
64 {
66 }
67 }
68
69 private readonly int _sign;
70
72 : base(child)
73 {
74 _sign = sign;
75 }
76
78 {
79 using IEnumerator<long?> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true);
80 if (!enumerator.MoveNext())
81 {
82 return null;
83 }
84 long? num = enumerator.Current;
85 if (_sign == -1)
86 {
87 while (enumerator.MoveNext())
88 {
89 long? current = enumerator.Current;
90 if (!num.HasValue || current < num)
91 {
92 num = current;
93 }
94 }
95 }
96 else
97 {
98 while (enumerator.MoveNext())
99 {
100 long? current2 = enumerator.Current;
101 if (!num.HasValue || current2 > num)
102 {
103 num = current2;
104 }
105 }
106 }
107 return num;
108 }
109
114}
NullableLongMinMaxAggregationOperatorEnumerator(QueryOperatorEnumerator< long?, TKey > source, int partitionIndex, int sign, CancellationToken cancellationToken)
override QueryOperatorEnumerator< long?, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< long?, TKey > source, object sharedData, CancellationToken cancellationToken)
override? long InternalAggregate(ref Exception singularExceptionToThrow)