Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
IntMinMaxAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class IntMinMaxAggregationOperator : InlinedAggregationOperator<int, int, int>
7{
9 {
11
12 private readonly int _sign;
13
20
21 protected override bool MoveNextCore(ref int 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 int currentElement2 = 0;
31 while (source.MoveNext(ref currentElement2, ref currentKey))
32 {
33 if ((num++ & 0x3F) == 0)
34 {
36 }
38 {
40 }
41 }
42 }
43 else
44 {
45 int currentElement3 = 0;
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<int> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true);
80 if (!enumerator.MoveNext())
81 {
83 return 0;
84 }
85 int num = enumerator.Current;
86 if (_sign == -1)
87 {
88 while (enumerator.MoveNext())
89 {
90 int current = enumerator.Current;
91 if (current < num)
92 {
93 num = current;
94 }
95 }
96 }
97 else
98 {
99 while (enumerator.MoveNext())
100 {
101 int current2 = enumerator.Current;
102 if (current2 > num)
103 {
104 num = current2;
105 }
106 }
107 }
108 return num;
109 }
110
115}
IntMinMaxAggregationOperatorEnumerator(QueryOperatorEnumerator< int, TKey > source, int partitionIndex, int sign, CancellationToken cancellationToken)
override int InternalAggregate(ref Exception singularExceptionToThrow)
IntMinMaxAggregationOperator(IEnumerable< int > child, int sign)
override QueryOperatorEnumerator< int, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< int, TKey > source, object sharedData, CancellationToken cancellationToken)
static string NoElements
Definition SR.cs:16
Definition SR.cs:7