Skip to content

Commit

Permalink
Removing StringBuilder in a case where it would be slower than String…
Browse files Browse the repository at this point in the history
…+ operator
  • Loading branch information
mkarg committed Dec 23, 2024
1 parent fb4af53 commit 998ccbe
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/java/com/beust/jcommander/JCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,8 @@ public void parseWithoutValidation(String... args) {
}

private void parse(boolean validate, String... args) {
StringBuilder sb = new StringBuilder("Parsing \"");
sb.append(String.join(" ", args)).append("\"\n with:").append(Strings.join(" ", objects.toArray()));
p(sb.toString());
p("Parsing \""
+ String.join(" ", args) + "\"\n with:" + Strings.join(" ", objects.toArray()));

if (descriptions == null) createDescriptions();
initializeDefaultValues();
Expand Down

0 comments on commit 998ccbe

Please sign in to comment.