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