Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
LongAverageAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class LongAverageAggregationOperator : InlinedAggregationOperator<long, Pair<long, long>, double>
7{
9 {
11
17
19 {
20 long num = 0L;
21 long num2 = 0L;
23 long currentElement2 = 0L;
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 }
35 {
36 num += currentElement2;
37 num2++;
38 }
39 }
40 while (source.MoveNext(ref currentElement2, ref currentKey));
42 return true;
43 }
44 return false;
45 }
46
47 protected override void Dispose(bool disposing)
48 {
50 }
51 }
52
54 : base(child)
55 {
56 }
57
59 {
61 {
63 if (!enumerator.MoveNext())
64 {
66 return 0.0;
67 }
68 Pair<long, long> current = enumerator.Current;
69 while (enumerator.MoveNext())
70 {
71 current.First += enumerator.Current.First;
72 current.Second += enumerator.Current.Second;
73 }
74 return (double)current.First / (double)current.Second;
75 }
76 }
77
82}
LongAverageAggregationOperatorEnumerator(QueryOperatorEnumerator< long, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override QueryOperatorEnumerator< Pair< long, long >, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< long, TKey > source, object sharedData, CancellationToken cancellationToken)
override double InternalAggregate(ref Exception singularExceptionToThrow)
static string NoElements
Definition SR.cs:16
Definition SR.cs:7