Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
NullableDecimalSumAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class NullableDecimalSumAggregationOperator : InlinedAggregationOperator<decimal?, decimal?, decimal?>
7{
9 {
11
17
18 protected override bool MoveNextCore(ref decimal? currentElement)
19 {
20 decimal? currentElement2 = null;
21 TKey currentKey = default(TKey);
23 if (source.MoveNext(ref currentElement2, ref currentKey))
24 {
25 decimal value = 0.0m;
26 int num = 0;
27 do
28 {
29 if ((num++ & 0x3F) == 0)
30 {
32 }
33 value += currentElement2.GetValueOrDefault();
34 }
35 while (source.MoveNext(ref currentElement2, ref currentKey));
37 return true;
38 }
39 return false;
40 }
41
42 protected override void Dispose(bool disposing)
43 {
45 }
46 }
47
52
54 {
55 using IEnumerator<decimal?> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true);
56 decimal value = 0.0m;
57 while (enumerator.MoveNext())
58 {
59 value += enumerator.Current.GetValueOrDefault();
60 }
61 return value;
62 }
63
68}
NullableDecimalSumAggregationOperatorEnumerator(QueryOperatorEnumerator< decimal?, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override QueryOperatorEnumerator< decimal?, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< decimal?, TKey > source, object sharedData, CancellationToken cancellationToken)
override? decimal InternalAggregate(ref Exception singularExceptionToThrow)