mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-01 22:20:06 +00:00
Workaround missed optimization opportunity
This commit is contained in:
parent
eef4ba9c02
commit
cdf877d4b1
@ -1685,7 +1685,8 @@ template <typename OutputIt, typename Char, typename W>
|
||||
FMT_CONSTEXPR FMT_INLINE OutputIt
|
||||
write_int(OutputIt out, int num_digits, string_view prefix,
|
||||
const basic_format_specs<Char>& specs, W write_digits) {
|
||||
if (specs.width == 0 && specs.precision < 0) {
|
||||
// Slightly faster check for specs.width == 0 && specs.precision == -1.
|
||||
if ((specs.width | (specs.precision + 1)) == 0) {
|
||||
auto it = reserve(out, to_unsigned(num_digits) + prefix.size());
|
||||
if (prefix.size() != 0)
|
||||
it = copy_str<Char>(prefix.begin(), prefix.end(), it);
|
||||
|
Loading…
Reference in New Issue
Block a user