Refine use of substring operations
Closes gh-25445
This commit is contained in:
@@ -269,7 +269,7 @@ public class StompDecoder {
|
||||
int index = inString.indexOf('\\');
|
||||
|
||||
while (index >= 0) {
|
||||
sb.append(inString.substring(pos, index));
|
||||
sb.append(inString, pos, index);
|
||||
if (index + 1 >= inString.length()) {
|
||||
throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ public class StompEncoder {
|
||||
private StringBuilder getStringBuilder(@Nullable StringBuilder sb, String inString, int i) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuilder(inString.length());
|
||||
sb.append(inString.substring(0, i));
|
||||
sb.append(inString, 0, i);
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user