mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8335645: j.u.Formatter#trailingZeros improved with String repeat
Reviewed-by: liach, jlu, naoto
This commit is contained in:
parent
c8acea87e2
commit
194425d787
1 changed files with 2 additions and 2 deletions
|
@ -4249,8 +4249,8 @@ public final class Formatter implements Closeable, Flushable {
|
||||||
|
|
||||||
// Add trailing zeros
|
// Add trailing zeros
|
||||||
private void trailingZeros(StringBuilder sb, int nzeros) {
|
private void trailingZeros(StringBuilder sb, int nzeros) {
|
||||||
for (int i = 0; i < nzeros; i++) {
|
if (nzeros > 0) {
|
||||||
sb.append('0');
|
sb.repeat('0', nzeros);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue