Skip to content

Commit 4df0631

Browse files
committed
Replace std::fill_n with fmt::detail::fill_n
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
1 parent 74a1872 commit 4df0631

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

include/fmt/chrono.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ enum class pad_type {
693693
template <typename OutputIt>
694694
auto write_padding(OutputIt out, pad_type pad, int width) -> OutputIt {
695695
if (pad == pad_type::none) return out;
696-
return std::fill_n(out, width, pad == pad_type::space ? ' ' : '0');
696+
return detail::fill_n(out, width, pad == pad_type::space ? ' ' : '0');
697697
}
698698

699699
template <typename OutputIt>
@@ -1149,14 +1149,14 @@ void write_fractional_seconds(OutputIt& out, Duration d, int precision = -1) {
11491149
if (std::ratio_less<typename subsecond_precision::period,
11501150
std::chrono::seconds::period>::value) {
11511151
*out++ = '.';
1152-
out = std::fill_n(out, leading_zeroes, '0');
1152+
out = detail::fill_n(out, leading_zeroes, '0');
11531153
out = format_decimal<Char>(out, n, num_digits).end;
11541154
}
11551155
} else if (precision > 0) {
11561156
*out++ = '.';
11571157
leading_zeroes = (std::min)(leading_zeroes, precision);
11581158
int remaining = precision - leading_zeroes;
1159-
out = std::fill_n(out, leading_zeroes, '0');
1159+
out = detail::fill_n(out, leading_zeroes, '0');
11601160
if (remaining < num_digits) {
11611161
int num_truncated_digits = num_digits - remaining;
11621162
n /= to_unsigned(detail::pow10(to_unsigned(num_truncated_digits)));
@@ -1169,7 +1169,7 @@ void write_fractional_seconds(OutputIt& out, Duration d, int precision = -1) {
11691169
out = format_decimal<Char>(out, n, num_digits).end;
11701170
remaining -= num_digits;
11711171
}
1172-
out = std::fill_n(out, remaining, '0');
1172+
out = detail::fill_n(out, remaining, '0');
11731173
}
11741174
}
11751175

@@ -1320,7 +1320,8 @@ class tm_writer {
13201320
}
13211321
uint32_or_64_or_128_t<long long> n = to_unsigned(year);
13221322
const int num_digits = count_digits(n);
1323-
if (width > num_digits) out_ = std::fill_n(out_, width - num_digits, '0');
1323+
if (width > num_digits)
1324+
out_ = detail::fill_n(out_, width - num_digits, '0');
13241325
out_ = format_decimal<Char>(out_, n, num_digits).end;
13251326
}
13261327
void write_year(long long year) {

0 commit comments

Comments
 (0)