Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CountAggregationOperator.cs
Go to the documentation of this file.
3
5
6internal sealed class CountAggregationOperator<TSource> : InlinedAggregationOperator<TSource, int, int>
7{
9 {
11
17
18 protected override bool MoveNextCore(ref int currentElement)
19 {
20 TSource currentElement2 = default(TSource);
21 TKey currentKey = default(TKey);
23 if (source.MoveNext(ref currentElement2, ref currentKey))
24 {
25 int num = 0;
26 int num2 = 0;
27 do
28 {
29 if ((num2++ & 0x3F) == 0)
30 {
32 }
33 num = checked(num + 1);
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<int> enumerator = GetEnumerator(ParallelMergeOptions.FullyBuffered, suppressOrderPreservation: true);
56 int num = 0;
57 while (enumerator.MoveNext())
58 {
59 num = checked(num + enumerator.Current);
60 }
61 return num;
62 }
63
68}
CountAggregationOperatorEnumerator(QueryOperatorEnumerator< TSource, TKey > source, int partitionIndex, CancellationToken cancellationToken)
override int InternalAggregate(ref Exception singularExceptionToThrow)
override QueryOperatorEnumerator< int, int > CreateEnumerator< TKey >(int index, int count, QueryOperatorEnumerator< TSource, TKey > source, object sharedData, CancellationToken cancellationToken)