StringBuilder is a CharSequence, hence turning it into a String
just to get a character from it is wasteful.
Change-Id: Icba9d5b7ebc1207498a06b41fec84aa74a19ff3b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
78da6b0de0b2c5673ff144b043ef6aaf506a88b7)
}
}
if (!Character.isJavaIdentifierPart(actualChar)) {
- // prepare actual string of sb for checking if underscore exist on position of the
- // last char
- final String partialConvertedIdentifier = sb.toString();
- sb.append(convert(actualChar, existNext(identifier, i),
- partialConvertedIdentifier.charAt(partialConvertedIdentifier.length() - 1)));
+ // prepare actual string of sb for checking if underscore exist on position of the last char
+ sb.append(convert(actualChar, existNext(identifier, i), sb.charAt(sb.length() - 1)));
} else {
sb.append(actualChar);
}