Polish: String function use should be optimized for single characters

(cherry picked from commit 49fd724)
This commit is contained in:
igor-suhorukov
2018-02-25 20:34:35 +01:00
committed by Juergen Hoeller
parent 073e78b68d
commit 39ddd0f349
23 changed files with 32 additions and 32 deletions

View File

@@ -251,7 +251,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));
@@ -276,7 +276,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));