You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2021/05/28 16:02:14 UTC
[lucenenet] 02/02: Lucene.Net.Grouping: Added comments to change
!Any() to .Count when IEnumerable is factored out
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 b03b93683c4d3a7128e54692525cb7d1315637f5
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Fri May 28 21:58:34 2021 +0700
Lucene.Net.Grouping: Added comments to change !Any() to .Count when IEnumerable<T> is factored out
---
src/Lucene.Net.Grouping/AbstractSecondPassGroupingCollector.cs | 2 +-
src/Lucene.Net.Grouping/SearchGroup.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 ea35fb2..7d4d8f5 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.Any())
+ if (!groups.Any()) // LUCENENET TODO: Change back to .Count if/when IEnumerable<T> is changed to ICollection<T> or IReadOnlyCollection<T>
{
throw new ArgumentException("no groups to collect (groups.Count is 0)");
}
diff --git a/src/Lucene.Net.Grouping/SearchGroup.cs b/src/Lucene.Net.Grouping/SearchGroup.cs
index 27ae921..580ed50 100644
--- a/src/Lucene.Net.Grouping/SearchGroup.cs
+++ b/src/Lucene.Net.Grouping/SearchGroup.cs
@@ -402,7 +402,7 @@ namespace Lucene.Net.Search.Grouping
for (int shardIDX = 0; shardIDX < shards.Count; shardIDX++)
{
IEnumerable<ISearchGroup<T>> shard = shards[shardIDX];
- if (shard.Any())
+ if (shard.Any()) // LUCENENET TODO: Change back to .Count if/when IEnumerable<T> is changed to ICollection<T> or IReadOnlyCollection<T>
{
//System.out.println(" insert shard=" + shardIDX);
UpdateNextGroup(maxQueueSize, new ShardIter<T>(shard, shardIDX));