Reduce the overhead of char[] creation

See gh-24204
This commit is contained in:
Marten Deinum
2020-11-18 13:40:01 +01:00
committed by Stephane Nicoll
parent c063c3434d
commit 5121ca5d17
4 changed files with 8 additions and 4 deletions

View File

@@ -189,7 +189,8 @@ public class ConfigurationMetadata {
static String toDashedCase(String name) {
StringBuilder dashed = new StringBuilder();
Character previous = null;
for (char current : name.toCharArray()) {
for (int i = 0; i < name.length(); i++) {
char current = name.charAt(i);
if (SEPARATORS.contains(current)) {
dashed.append("-");
}