add comments to clarify code

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1602140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2014-06-12 12:26:20 +00:00
parent 51412938e5
commit b710568e76
1 changed files with 3 additions and 1 deletions

View File

@ -185,11 +185,13 @@ class ReadersAndUpdates {
getReader(context).decRef();
assert reader != null;
}
// force new liveDocs in initWritableLiveDocs even if it's null
liveDocsShared = true;
if (liveDocs != null) {
return new SegmentReader(reader.getSegmentInfo(), reader, liveDocs, info.info.getDocCount() - info.getDelCount() - pendingDeleteCount);
} else {
assert reader.getLiveDocs() == liveDocs;
// liveDocs == null and reader != null. That can only be if there are no deletes
assert reader.getLiveDocs() == null;
reader.incRef();
return reader;
}