Skip to content

Commit

Permalink
Use a single call to append() for each character in toEscapedString()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory authored Sep 22, 2024
1 parent 012e620 commit 7ad7439
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ String toEscapedString(final X500Principal principal) {
final StringBuilder sanitizedPrincipal = new StringBuilder(principalValue.length());
for (final char c : principalValue.toCharArray()) {
if (Character.isISOControl(c)) {
sanitizedPrincipal.append("\\x").append(String.format("%02x", (int) c));
sanitizedPrincipal.append(String.format("\\x%02x", (int) c));
} else {
sanitizedPrincipal.append(c);
}
Expand Down

0 comments on commit 7ad7439

Please sign in to comment.