Skip to content

Commit

Permalink
Polish
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Dec 26, 2023
1 parent 2c1817d commit f8760ad
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ public void visitApply(JCTree.JCMethodInvocation tree) {
}

private String indent(String code, int width) {
String indent = "$1" + String.join("", Collections.nCopies(width, " "));
return code.replaceAll("(?m)(\\R)", indent);
char[] indent = new char[width];
Arrays.fill(indent, ' ');
String replacement = "$1" + new String(indent);
return code.replaceAll("(?m)(\\R)", replacement);
}
}.scan(cu);
}
Expand Down

0 comments on commit f8760ad

Please sign in to comment.