Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DecimalAverageAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class DecimalAverageAggregationOperator : InlinedAggregationOperator<decimal, Pair<decimal, long>, decimal>
7{
9 {
11
17
19 {
20 decimal first = 0.0m;
21 long num = 0L;
23 decimal currentElement2 = default(decimal);
24 TKey currentKey = default(TKey);
25 if (source.MoveNext(ref currentElement2, ref currentKey))
26 {
27 int num2 = 0;
28 do
29 {
30 if ((num2++ & 0x3F) == 0)
31 {
33 }
35 num = checked(num + 1);
36 }
37 while (source.MoveNext(ref currentElement2, ref currentKey));
39 return true;
40 }
41 return false;
42 }
43
44 protected override void Dispose(bool disposing)
45 {
47 }
48 }
49
51 : base(child)
52 {
53 }
54
56 {
58 {
60 if (!enumerator.MoveNext())
61 {
63 return 0m;
64 }
65 Pair<decimal, long> current = enumerator.Current;
66 while (enumerator.MoveNext())
67 {
68 current.First += enumerator.Current.First;
69 current.Second += enumerator.Current.Second;
70 }
71 return current.First / (decimal)current.Second;
72 }
73 }
74
79}
DecimalAverageAggregationOperatorEnumerator(QueryOperatorEnumerator< decimal, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override QueryOperatorEnumerator< Pair< decimal, long >, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< decimal, TKey > source, object sharedData, CancellationToken cancellationToken)
override decimal InternalAggregate(ref Exception singularExceptionToThrow)
static string NoElements
Definition SR.cs:16
Definition SR.cs:7