From 996b437530efee1afe39e9c81c4878f993d7412e Mon Sep 17 00:00:00 2001 From: MateoMiller <64360473+MateoMiller@users.noreply.github.com> Date: Sun, 16 Oct 2022 18:44:36 +0500 Subject: [PATCH] Removed unnecessary null check If count is more than 0, then bucket is not null. If count is zero, then bucket is null. So check for null condition is not necessary --- MoreLinq/Batch.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MoreLinq/Batch.cs b/MoreLinq/Batch.cs index 4621f46cf..4c3102dd2 100644 --- a/MoreLinq/Batch.cs +++ b/MoreLinq/Batch.cs @@ -144,7 +144,7 @@ IEnumerable Batch(int size) } // Return the last bucket with all remaining elements - if (bucket != null && count > 0) + if (count > 0) { Array.Resize(ref bucket, count); yield return resultSelector(bucket);