Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
original-brownbear committed Sep 20, 2024
1 parent e7a3703 commit cc6a217
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ public void writeWithSizePrefix(Writeable writeable) throws IOException {
}
}

// overridden with some code duplication the same way other write methods in this class are overridden to bypass StreamOutput's
// intermediary buffers
@Override
public void writeString(String str) throws IOException {
final int currentPageOffset = this.currentPageOffset;
Expand All @@ -189,6 +191,7 @@ public void writeString(String str) throws IOException {
BytesRef currentPage = pages.get(pageIndex).v();
int off = currentPage.offset + currentPageOffset;
byte[] buffer = currentPage.bytes;
// mostly duplicated from StreamOutput.writeString to to get more reliable compilation of this very hot loop
int offset = off + putVInt(buffer, charCount, off);
for (int i = 0; i < charCount; i++) {
final int c = str.charAt(i);
Expand Down

0 comments on commit cc6a217

Please sign in to comment.