From 2bdd6fd6c3f3406d1aff557d4651326b398ad9ba Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 29 Jun 2024 01:19:42 -0400 Subject: [PATCH] Finish fixing MaxMany, MaxManyBy, and MinMany --- CSharp.Nixill/src/Utils/EnumerableUtils.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CSharp.Nixill/src/Utils/EnumerableUtils.cs b/CSharp.Nixill/src/Utils/EnumerableUtils.cs index b1178a8..9f1b250 100644 --- a/CSharp.Nixill/src/Utils/EnumerableUtils.cs +++ b/CSharp.Nixill/src/Utils/EnumerableUtils.cs @@ -62,7 +62,7 @@ public static IEnumerable Of(T item) public static IEnumerable MaxMany(this IEnumerable list) where T : IComparable { T baseline = default(T); - List allItems = null; + List allItems = new(); bool assigned = false; foreach (T item in list) @@ -85,7 +85,7 @@ public static IEnumerable MaxMany(this IEnumerable list) where T : ICom public static IEnumerable MaxMany(this IEnumerable list, IComparer comp) { T baseline = default(T); - List allItems = null; + List allItems = new(); bool assigned = false; Comparison cFunc = comp.Compare; @@ -110,7 +110,7 @@ public static IEnumerable MaxManyBy(this IEnumerable< Func mutator) where TResult : IComparable { TResult baseline = default(TResult); - List allItems = null; + List allItems = new(); bool assigned = false; foreach (TSource item in list) @@ -135,7 +135,7 @@ public static IEnumerable MaxManyBy(this IEnumerable< Func mutator, IComparer comp) { TResult baseline = default(TResult); - List allItems = null; + List allItems = new(); bool assigned = false; Comparison cFunc = comp.Compare; @@ -160,7 +160,7 @@ public static IEnumerable MaxManyBy(this IEnumerable< public static IEnumerable MinMany(this IEnumerable list) where T : IComparable { T baseline = default(T); - List allItems = null; + List allItems = new(); bool assigned = false; foreach (T item in list) @@ -183,7 +183,7 @@ public static IEnumerable MinMany(this IEnumerable list) where T : ICom public static IEnumerable MinMany(this IEnumerable list, IComparer comp) { T baseline = default(T); - List allItems = null; + List allItems = new(); bool assigned = false; Comparison cFunc = comp.Compare;