Fix compilation after forward port of #10368
Motivation: Code failed to compile because ByteBuf index marking has been removed. Modification: Index marking wasn't really used anyway, so just set the relevant index to zero. Result: Code compiles again.
This commit is contained in:
parent
7f86f90646
commit
1d7efbddd9
@ -172,7 +172,7 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
|
||||
private int nestedByteBufUtilWriteUtf8String6(String string) {
|
||||
// this calls should be inlined but...what happen to the subsequent calls > MaxInlineLevel?
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, string, 0, string.length());
|
||||
return buffer.writerIndex();
|
||||
}
|
||||
@ -182,7 +182,7 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
public int byteBufUtilWriteUtf8String() {
|
||||
int countBytes = 0;
|
||||
for (String string : strings) {
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, string, 0, string.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
}
|
||||
@ -196,10 +196,10 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
for (int i = 0, size = dataSetLength; i < size; i++) {
|
||||
final StringBuilder stringBuilder = stringBuilders[i];
|
||||
final String string = strings[i];
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, stringBuilder, 0, stringBuilder.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, string, 0, string.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
}
|
||||
@ -214,13 +214,13 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
final StringBuilder stringBuilder = stringBuilders[i];
|
||||
final String string = strings[i];
|
||||
final AnotherCharSequence anotherCharSequence = anotherCharSequences[i];
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, stringBuilder, 0, stringBuilder.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, string, 0, string.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, anotherCharSequence, 0, anotherCharSequence.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
}
|
||||
@ -235,13 +235,13 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
final StringBuilder stringBuilder = stringBuilders[i];
|
||||
final String string = strings[i];
|
||||
final AsciiString asciiString = asciiStrings[i];
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, stringBuilder, 0, stringBuilder.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, string, 0, string.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, asciiString, 0, asciiString.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
}
|
||||
@ -254,7 +254,7 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
int countBytes = 0;
|
||||
for (int i = 0, size = dataSetLength; i < size; i++) {
|
||||
final AsciiString asciiString = asciiStrings[i];
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
ByteBufUtil.writeUtf8(buffer, asciiString, 0, asciiString.length());
|
||||
countBytes += buffer.writerIndex();
|
||||
}
|
||||
@ -266,7 +266,7 @@ public class Utf8EncodingBenchmark extends AbstractMicrobenchmark {
|
||||
public int writeGetBytes() throws UnsupportedEncodingException {
|
||||
int countBytes = 0;
|
||||
for (String string : strings) {
|
||||
buffer.resetWriterIndex();
|
||||
buffer.writerIndex(0);
|
||||
final byte[] bytes = string.getBytes("UTF-8");
|
||||
buffer.writeBytes(bytes);
|
||||
countBytes += buffer.writerIndex();
|
||||
|
Loading…
Reference in New Issue
Block a user