Skip to content
Closed
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
44 changes: 8 additions & 36 deletions src/java.base/share/classes/java/lang/StringConcatHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,35 +236,21 @@ static long prepend(long indexCoder, byte[] buf, boolean value, String prefix) {
if (indexCoder < UTF16) {
if (value) {
index -= 4;
buf[index] = 't';
buf[index + 1] = 'r';
buf[index + 2] = 'u';
buf[index + 3] = 'e';
StringLatin1.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
buf[index] = 'f';
buf[index + 1] = 'a';
buf[index + 2] = 'l';
buf[index + 3] = 's';
buf[index + 4] = 'e';
StringLatin1.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.LATIN1);
return index;
} else {
if (value) {
index -= 4;
StringUTF16.putChar(buf, index, 't');
StringUTF16.putChar(buf, index + 1, 'r');
StringUTF16.putChar(buf, index + 2, 'u');
StringUTF16.putChar(buf, index + 3, 'e');
StringUTF16.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
StringUTF16.putChar(buf, index, 'f');
StringUTF16.putChar(buf, index + 1, 'a');
StringUTF16.putChar(buf, index + 2, 'l');
StringUTF16.putChar(buf, index + 3, 's');
StringUTF16.putChar(buf, index + 4, 'e');
StringUTF16.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.UTF16);
Expand Down Expand Up @@ -638,34 +624,20 @@ static int prepend(int index, byte coder, byte[] buf, boolean value, String pref
if (coder == String.LATIN1) {
if (value) {
index -= 4;
buf[index] = 't';
buf[index + 1] = 'r';
buf[index + 2] = 'u';
buf[index + 3] = 'e';
StringLatin1.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
buf[index] = 'f';
buf[index + 1] = 'a';
buf[index + 2] = 'l';
buf[index + 3] = 's';
buf[index + 4] = 'e';
StringLatin1.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.LATIN1);
} else {
if (value) {
index -= 4;
StringUTF16.putChar(buf, index, 't');
StringUTF16.putChar(buf, index + 1, 'r');
StringUTF16.putChar(buf, index + 2, 'u');
StringUTF16.putChar(buf, index + 3, 'e');
StringUTF16.putCharsAt(buf, index, 't', 'r', 'u', 'e');
} else {
index -= 5;
StringUTF16.putChar(buf, index, 'f');
StringUTF16.putChar(buf, index + 1, 'a');
StringUTF16.putChar(buf, index + 2, 'l');
StringUTF16.putChar(buf, index + 3, 's');
StringUTF16.putChar(buf, index + 4, 'e');
StringUTF16.putCharsAt(buf, index, 'f', 'a', 'l', 's', 'e');
}
index -= prefix.length();
prefix.getBytes(buf, index, String.UTF16);
Expand Down