You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2023/04/08 06:46:51 UTC

[GitHub] [camel] davsclaus commented on a diff in pull request #9828: Optimization of loops with the only action of appending a string several times

davsclaus commented on code in PR #9828:
URL: https://github.com/apache/camel/pull/9828#discussion_r1161073658


##########
catalog/camel-report-maven-plugin/src/main/java/org/apache/camel/maven/RouteCoverageMojo.java:
##########
@@ -503,9 +503,7 @@ private static void gatherRouteCoverageSummary(
 
     private static String padString(int level) {
         StringBuilder sb = new StringBuilder();
-        for (int i = 0; i < level; i++) {
-            sb.append("  ");
-        }
+        sb.append("  ".repeat(Math.max(0, level)));

Review Comment:
   Should it not just be .repeat(level). The level is not intended to be negative



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org