mirror of https://github.com/apache/lucene.git
fix comments, no functional change
PR: 31748 Submitted by: Paul Elschot git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150616 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8aaf570ed6
commit
1aa4ae4a31
src/java/org/apache/lucene/store
|
@ -116,7 +116,6 @@ public class MMapDirectory extends FSDirectory {
|
||||||
int bufSize = (length > (bufferStart + maxBufSize))
|
int bufSize = (length > (bufferStart + maxBufSize))
|
||||||
? maxBufSize
|
? maxBufSize
|
||||||
: (int) (length - bufferStart);
|
: (int) (length - bufferStart);
|
||||||
//System.out.println("mapping from: "+bufferStart+", size: "+bufSize);
|
|
||||||
this.buffers[bufNr] = rafc.map(MapMode.READ_ONLY,bufferStart,bufSize);
|
this.buffers[bufNr] = rafc.map(MapMode.READ_ONLY,bufferStart,bufSize);
|
||||||
this.bufSizes[bufNr] = bufSize;
|
this.bufSizes[bufNr] = bufSize;
|
||||||
bufferStart += bufSize;
|
bufferStart += bufSize;
|
||||||
|
@ -129,8 +128,8 @@ public class MMapDirectory extends FSDirectory {
|
||||||
// eg. 128 bytes and readByte() from there.
|
// eg. 128 bytes and readByte() from there.
|
||||||
if (curAvail == 0) {
|
if (curAvail == 0) {
|
||||||
curBufIndex++;
|
curBufIndex++;
|
||||||
curBuf = buffers[curBufIndex];
|
curBuf = buffers[curBufIndex]; // index out of bounds when too many bytes requested
|
||||||
curBuf.position(0); // index out of bounds when too many requested
|
curBuf.position(0);
|
||||||
curAvail = bufSizes[curBufIndex];
|
curAvail = bufSizes[curBufIndex];
|
||||||
}
|
}
|
||||||
curAvail--;
|
curAvail--;
|
||||||
|
@ -143,8 +142,8 @@ public class MMapDirectory extends FSDirectory {
|
||||||
len -= curAvail;
|
len -= curAvail;
|
||||||
offset += curAvail;
|
offset += curAvail;
|
||||||
curBufIndex++;
|
curBufIndex++;
|
||||||
curBuf = buffers[curBufIndex];
|
curBuf = buffers[curBufIndex]; // index out of bounds when too many bytes requested
|
||||||
curBuf.position(0); // index out of bounds when too many requested
|
curBuf.position(0);
|
||||||
curAvail = bufSizes[curBufIndex];
|
curAvail = bufSizes[curBufIndex];
|
||||||
}
|
}
|
||||||
curBuf.get(b, offset, len);
|
curBuf.get(b, offset, len);
|
||||||
|
|
Loading…
Reference in New Issue