mirror of https://github.com/apache/lucene.git
remove otherBuffer/otherByteBuf tracking: this is pointless now that compound files are handled as slices
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1232084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5ff6f19980
commit
dee0f7bd55
|
@ -110,9 +110,6 @@ public class NIOFSDirectory extends FSDirectory {
|
|||
|
||||
private ByteBuffer byteBuf; // wraps the buffer for NIO
|
||||
|
||||
private byte[] otherBuffer;
|
||||
private ByteBuffer otherByteBuf;
|
||||
|
||||
final FileChannel channel;
|
||||
|
||||
public NIOFSIndexInput(File path, IOContext context, int chunkSize) throws IOException {
|
||||
|
@ -157,22 +154,7 @@ public class NIOFSDirectory extends FSDirectory {
|
|||
byteBuf.limit(len);
|
||||
bb = byteBuf;
|
||||
} else {
|
||||
if (offset == 0) {
|
||||
if (otherBuffer != b) {
|
||||
// Now wrap this other buffer; with compound
|
||||
// file, we are repeatedly called with its
|
||||
// buffer, so we wrap it once and then re-use it
|
||||
// on subsequent calls
|
||||
otherBuffer = b;
|
||||
otherByteBuf = ByteBuffer.wrap(b);
|
||||
} else
|
||||
otherByteBuf.clear();
|
||||
otherByteBuf.limit(len);
|
||||
bb = otherByteBuf;
|
||||
} else {
|
||||
// Always wrap when offset != 0
|
||||
bb = ByteBuffer.wrap(b, offset, len);
|
||||
}
|
||||
bb = ByteBuffer.wrap(b, offset, len);
|
||||
}
|
||||
|
||||
int readOffset = bb.position();
|
||||
|
|
Loading…
Reference in New Issue