Reduce the overhead of char[] creation
See gh-24204
This commit is contained in:
committed by
Stephane Nicoll
parent
c063c3434d
commit
5121ca5d17
@@ -81,7 +81,8 @@ public class SimpleHttpCodeStatusMapper implements HttpCodeStatusMapper {
|
||||
return null;
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (char ch : code.toCharArray()) {
|
||||
for (int i = 0; i < code.length(); i++) {
|
||||
char ch = code.charAt(i);
|
||||
if (Character.isAlphabetic(ch) || Character.isDigit(ch)) {
|
||||
builder.append(Character.toLowerCase(ch));
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ public class SimpleStatusAggregator implements StatusAggregator {
|
||||
return null;
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (char ch : code.toCharArray()) {
|
||||
for (int i = 0; i < code.length(); i++) {
|
||||
char ch = code.charAt(i);
|
||||
if (Character.isAlphabetic(ch) || Character.isDigit(ch)) {
|
||||
builder.append(Character.toLowerCase(ch));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user