Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MakeFinalReduceFunction()

static Func< Pair< bool, T >, Pair< bool, T >, Pair< bool, T > > System.Linq.AggregationMinMaxHelpers< T >.MakeFinalReduceFunction ( int sign)
inlinestaticprivate

Definition at line 33 of file AggregationMinMaxHelpers.cs.

34 {
35 Comparer<T> comparer = Util.GetDefaultComparer<T>();
36 return (Pair<bool, T> accumulator, Pair<bool, T> element) => (element.First && (!accumulator.First || Util.Sign(comparer.Compare(element.Second, accumulator.Second)) == sign)) ? new Pair<bool, T>(first: true, element.Second) : accumulator;
37 }
static int Sign(int x)
Definition Util.cs:57

References System.comparer, System.Linq.first, and System.Linq.Parallel.Util.Sign().

Referenced by System.Linq.AggregationMinMaxHelpers< T >.Reduce().