Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
Signed-off-by: mgodwan <[email protected]>
  • Loading branch information
mgodwan committed Feb 1, 2024
1 parent 91150dc commit 36925d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ public long size() {
@Override
public synchronized long get(long index) {
try {
// Multiplying by 8 since each long is 8 bytes, and we need to get the long value at (index * 8) in the
// RandomAccessInput being accessed.
return input.readLong(index << 3);
} catch (IOException ex) {
throw new OpenSearchException(ex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class LongArrayBackedBitSet implements Accountable, Closeable {
*/
LongArrayBackedBitSet(IndexInput in) throws IOException {
underlyingArrayLength = in.readLong();
// Multiplying by 8 since this
// Multiplying by 8 since the length above is of the long array, so we will have
// 8 times the number of bytes in our stream.
long streamLength = underlyingArrayLength << 3;
this.longArray = new IndexInputImmutableLongArray(underlyingArrayLength, in.randomAccessSlice(in.getFilePointer(), streamLength));
in.skipBytes(streamLength);
Expand Down

0 comments on commit 36925d2

Please sign in to comment.