Use StringBuilder.append(char) where possible

To slightly improve performance, this commit switches to
StringBuilder.append(char) instead of StringBuilder.append(String)
whenever we append a single character to a StringBuilder.

Closes gh-27098
This commit is contained in:
Sam Brannen
2021-06-24 18:53:51 +02:00
parent ddbb7c1b5b
commit a2ef6badc4
74 changed files with 232 additions and 220 deletions

View File

@@ -276,14 +276,14 @@ public class AspectJAdviceParameterNameDiscovererTests {
private static String format(String[] names) {
StringBuilder sb = new StringBuilder();
sb.append("(");
sb.append('(');
for (int i = 0; i < names.length; i++) {
sb.append(names[i]);
if ((i + 1) < names.length) {
sb.append(",");
sb.append(',');
}
}
sb.append(")");
sb.append(')');
return sb.toString();
}