Polish: String function use should be optimized for single characters
(cherry picked from commit 49fd724)
This commit is contained in:
committed by
Juergen Hoeller
parent
073e78b68d
commit
39ddd0f349
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user