Polish: String function use should be optimized for single characters

This commit is contained in:
igor-suhorukov
2018-02-25 22:34:35 +03:00
committed by Juergen Hoeller
parent 9c55dd5961
commit 49fd724d8f
31 changed files with 42 additions and 42 deletions

View File

@@ -260,7 +260,7 @@ public class StompDecoder {
private String unescape(String inString) {
StringBuilder sb = new StringBuilder(inString.length());
int pos = 0; // position in the old string
int index = inString.indexOf("\\");
int index = inString.indexOf('\\');
while (index >= 0) {
sb.append(inString.substring(pos, index));
@@ -285,7 +285,7 @@ public class StompDecoder {
throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
}
pos = index + 2;
index = inString.indexOf("\\", pos);
index = inString.indexOf('\\', pos);
}
sb.append(inString.substring(pos));