You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "laimis (via GitHub)" <gi...@apache.org> on 2023/04/14 18:28:15 UTC

[GitHub] [lucenenet] laimis commented on a diff in pull request #837: IndexSearcher fix for virtual calls from constructor

laimis commented on code in PR #837:
URL: https://github.com/apache/lucenenet/pull/837#discussion_r1167165599


##########
src/Lucene.Net/Search/IndexSearcher.cs:
##########
@@ -135,13 +134,44 @@ public IndexSearcher(IndexReader r, TaskScheduler executor)
         /// <seealso cref="IndexReaderContext"/>
         /// <seealso cref="IndexReader.Context"/>
         public IndexSearcher(IndexReaderContext context, TaskScheduler executor)
+            : this(context, executor, allocateLeafSlices: executor is not null)
         {
-            if (Debugging.AssertsEnabled) Debugging.Assert(context.IsTopLevel,"IndexSearcher's ReaderContext must be topLevel for reader {0}", context.Reader);
+        }
+
+        /// <summary>
+        /// LUCENENET specific constructor that can be used by the subclasses to
+        /// control whether the leaf slices are allocated in the base class or subclass.
+        /// </summary>
+        /// <remarks>
+        /// If executor is non-<c>null</c> and you choose to skip allocating the leaf slices

Review Comment:
   Updated!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org