mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 09:31:42 +01:00
8359454: Enhance String handling
This commit is contained in:
committed by
Vitaly Provodin
parent
d299d9375b
commit
ee4670845c
@@ -1313,8 +1313,8 @@ abstract sealed class AbstractStringBuilder implements Appendable, CharSequence
|
||||
ensureCapacityInternal(count + len);
|
||||
shift(dstOffset, len);
|
||||
count += len;
|
||||
if (s instanceof String) {
|
||||
putStringAt(dstOffset, (String) s, start, end);
|
||||
if (s instanceof String str && str.length() == len) {
|
||||
putStringAt(dstOffset, str);
|
||||
} else {
|
||||
putCharsAt(dstOffset, s, start, end);
|
||||
}
|
||||
@@ -1741,11 +1741,6 @@ abstract sealed class AbstractStringBuilder implements Appendable, CharSequence
|
||||
}
|
||||
}
|
||||
|
||||
private void putStringAt(int index, String str, int off, int end) {
|
||||
inflateIfNeededFor(str);
|
||||
str.getBytes(value, off, index, coder, end - off);
|
||||
}
|
||||
|
||||
private void putStringAt(int index, String str) {
|
||||
inflateIfNeededFor(str);
|
||||
str.getBytes(value, index, coder);
|
||||
|
||||
Reference in New Issue
Block a user