this should be more foolproof

This commit is contained in:
Christopher Bohn 2024-02-26 03:30:26 -08:00
parent a1d350c561
commit f521d11b9b
1 changed files with 2 additions and 3 deletions

View File

@ -104,16 +104,15 @@ public final class AdventureUtil {
final int length = text.length();
final char[] chars = text.toCharArray();
final StringBuilder normalized = new StringBuilder();
for (int i = 0; i < length - 1; ++i) {
for (int i = 0; i < length; ++i) {
final char current = chars[i];
normalized.append(current);
if (current == LEGACY_CHARACTER) {
if (current == LEGACY_CHARACTER && i < length - 1) {
final char next = chars[i + 1];
normalized.append(Character.toLowerCase(next));
++i;
}
}
normalized.append(chars[length - 1]);
return normalized.toString();
}