mikemccand commented on a change in pull request #1941:
URL: https://github.com/apache/lucene-solr/pull/1941#discussion_r498907778



##########
File path: lucene/core/src/java/org/apache/lucene/index/IndexWriter.java
##########
@@ -1072,7 +1073,14 @@ public IndexWriter(Directory d, IndexWriterConfig conf) 
throws IOException {
 
       config.getFlushPolicy().init(config);
       bufferedUpdatesStream = new BufferedUpdatesStream(infoStream);
-      docWriter = new DocumentsWriter(flushNotifications, 
segmentInfos.getIndexCreatedVersionMajor(), pendingNumDocs,
+      final IntConsumer reserveDocs = numDocs -> {
+        if (numDocs > 0) {
+          reserveDocs(numDocs);

Review comment:
       I'm confused why we are calling separate methods when `numDocs` is 
negative or not?




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to