Skip to content

Commit

Permalink
Finish fixing MaxMany, MaxManyBy, and MinMany
Browse files Browse the repository at this point in the history
  • Loading branch information
Nixill committed Jun 29, 2024
1 parent 23e9c7a commit 2bdd6fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CSharp.Nixill/src/Utils/EnumerableUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static IEnumerable<T> Of<T>(T item)
public static IEnumerable<T> MaxMany<T>(this IEnumerable<T> list) where T : IComparable<T>
{
T baseline = default(T);
List<T> allItems = null;
List<T> allItems = new();
bool assigned = false;

foreach (T item in list)
Expand All @@ -85,7 +85,7 @@ public static IEnumerable<T> MaxMany<T>(this IEnumerable<T> list) where T : ICom
public static IEnumerable<T> MaxMany<T>(this IEnumerable<T> list, IComparer<T> comp)
{
T baseline = default(T);
List<T> allItems = null;
List<T> allItems = new();
bool assigned = false;
Comparison<T> cFunc = comp.Compare;

Expand All @@ -110,7 +110,7 @@ public static IEnumerable<TSource> MaxManyBy<TSource, TResult>(this IEnumerable<
Func<TSource, TResult> mutator) where TResult : IComparable<TResult>
{
TResult baseline = default(TResult);
List<TSource> allItems = null;
List<TSource> allItems = new();
bool assigned = false;

foreach (TSource item in list)
Expand All @@ -135,7 +135,7 @@ public static IEnumerable<TSource> MaxManyBy<TSource, TResult>(this IEnumerable<
Func<TSource, TResult> mutator, IComparer<TResult> comp)
{
TResult baseline = default(TResult);
List<TSource> allItems = null;
List<TSource> allItems = new();
bool assigned = false;
Comparison<TResult> cFunc = comp.Compare;

Expand All @@ -160,7 +160,7 @@ public static IEnumerable<TSource> MaxManyBy<TSource, TResult>(this IEnumerable<
public static IEnumerable<T> MinMany<T>(this IEnumerable<T> list) where T : IComparable<T>
{
T baseline = default(T);
List<T> allItems = null;
List<T> allItems = new();
bool assigned = false;

foreach (T item in list)
Expand All @@ -183,7 +183,7 @@ public static IEnumerable<T> MinMany<T>(this IEnumerable<T> list) where T : ICom
public static IEnumerable<T> MinMany<T>(this IEnumerable<T> list, IComparer<T> comp)
{
T baseline = default(T);
List<T> allItems = null;
List<T> allItems = new();
bool assigned = false;
Comparison<T> cFunc = comp.Compare;

Expand Down

0 comments on commit 2bdd6fd

Please sign in to comment.