mirror of
https://github.com/apache/lucene.git
synced 2025-03-04 07:19:18 +00:00
LUCENE-3631: just return numDocs from numDocs(); fix wrong IOContext; remove unnecessary final modifier
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1221414 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
4d51b9012b
commit
45f5e829eb
@ -111,7 +111,7 @@ public final class SegmentReader extends IndexReader {
|
||||
assert si.hasDeletions();
|
||||
|
||||
// ... but load our own deleted docs:
|
||||
liveDocs = new BitVector(si.dir, si.getDelFileName(), new IOContext(IOContext.READ, true));
|
||||
liveDocs = new BitVector(si.dir, si.getDelFileName(), context);
|
||||
numDocs = si.docCount - si.getDelCount();
|
||||
assert checkLiveCounts(false);
|
||||
|
||||
@ -210,11 +210,7 @@ public final class SegmentReader extends IndexReader {
|
||||
@Override
|
||||
public int numDocs() {
|
||||
// Don't call ensureOpen() here (it could affect performance)
|
||||
if (liveDocs != null) {
|
||||
return liveDocs.count();
|
||||
} else {
|
||||
return maxDoc();
|
||||
}
|
||||
return numDocs;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -371,7 +367,7 @@ public final class SegmentReader extends IndexReader {
|
||||
// share the underlying postings data) will map to the
|
||||
// same entry in the FieldCache. See LUCENE-1579.
|
||||
@Override
|
||||
public final Object getCoreCacheKey() {
|
||||
public Object getCoreCacheKey() {
|
||||
return core;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user