Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DoubleAverageAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class DoubleAverageAggregationOperator : InlinedAggregationOperator<double, Pair<double, long>, double>
7{
9 {
11
17
19 {
20 double num = 0.0;
21 long num2 = 0L;
23 double currentElement2 = 0.0;
24 TKey currentKey = default(TKey);
25 if (source.MoveNext(ref currentElement2, ref currentKey))
26 {
27 int num3 = 0;
28 do
29 {
30 if ((num3++ & 0x3F) == 0)
31 {
33 }
34 num += currentElement2;
35 num2 = checked(num2 + 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 0.0;
64 }
65 Pair<double, 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 / (double)current.Second;
72 }
73 }
74
79}
DoubleAverageAggregationOperatorEnumerator(QueryOperatorEnumerator< double, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override double InternalAggregate(ref Exception singularExceptionToThrow)
override QueryOperatorEnumerator< Pair< double, long >, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< double, TKey > source, object sharedData, CancellationToken cancellationToken)
static string NoElements
Definition SR.cs:16
Definition SR.cs:7