Reduce overhead of char[] creation
There are more locations which could benefit from not using a toCharArray on a String, but rather use the charAt method from the String itself. This to prevent an additional copy of the char[] being created.
This commit is contained in:
committed by
Juergen Hoeller
parent
9139cb85bd
commit
c9b27af64f
@@ -475,8 +475,8 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
|
||||
}
|
||||
if (Character.isJavaIdentifierStart(candidateToken.charAt(0)) &&
|
||||
Character.isLowerCase(candidateToken.charAt(0))) {
|
||||
char[] tokenChars = candidateToken.toCharArray();
|
||||
for (char tokenChar : tokenChars) {
|
||||
for (int i = 1; i < candidateToken.length(); i++) {
|
||||
char tokenChar = candidateToken.charAt(i);
|
||||
if (!Character.isJavaIdentifierPart(tokenChar)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user