This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit a525c9b8d9c573f130a86d2db9dd570a05df20b8
Author: marodev <[email protected]>
AuthorDate: Wed May 12 22:43:03 2021 +0200

    Fix SonarQube's "Any() should be used to test for emptiness" / Code Smell
---
 src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs | 2 +-
 src/dotnet/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs 
b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
index d498795..ea35fb2 100644
--- a/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
+++ b/src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Search.Grouping
         {
 
             //System.out.println("SP init");
-            if (groups.Count() == 0)
+            if (!groups.Any())
             {
                 throw new ArgumentException("no groups to collect 
(groups.Count is 0)");
             }
diff --git a/src/dotnet/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs 
b/src/dotnet/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
index ac5bb01..a506646 100644
--- a/src/dotnet/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
+++ b/src/dotnet/tools/Lucene.Net.Tests.Cli/EnumerableExtensions.cs
@@ -25,7 +25,7 @@ namespace Lucene.Net.Cli
     {
         public static IEnumerable<IEnumerable<T>> OptionalParameters<T>(this 
IEnumerable<IEnumerable<T>> input)
         {
-            if (input.Count() == 0)
+            if (!input.Any())
                 yield break;
             else
             {

Reply via email to