8335645: j.u.Formatter#trailingZeros improved with String repeat
Reviewed-by: liach, jlu, naoto
This commit is contained in:
parent
c8acea87e2
commit
194425d787
@ -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…
x
Reference in New Issue
Block a user