Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ $endif$

@Override
$if(BytesRef)$
public BytesRef getBytesRef(int position, BytesRef ignore) {
public BytesRef getBytesRef(int position, BytesRef scratch) {
scratch.bytes = value.bytes;
scratch.offset = value.offset;
scratch.length = value.length;
return scratch;
$else$
public $type$ get$Type$(int position) {
$endif$
return value;
$endif$
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,12 @@ public void testConstantBytesRefBlock() {
assertEmptyLookup(blockFactory, block);
assertInsertNulls(block);
releaseAndAssertBreaker(block);
// modify the offset
var v0 = block.getBytesRef(randomInt(positionCount), new BytesRef());
var v1 = block.getBytesRef(randomInt(positionCount), new BytesRef());
v1.length = 0;
var v2 = block.getBytesRef(randomInt(positionCount), new BytesRef());
assertThat(v2, equalTo(v0));
}
}

Expand Down