mirror of
https://github.com/fmtlib/fmt.git
synced 2025-03-01 01:13:32 +00:00
Avoid unnecessary check.
This commit is contained in:
parent
8ed2243a3c
commit
533c8214d4
@ -655,9 +655,10 @@ void fmt::BasicWriter<Char>::PrintfParser::Format(
|
|||||||
|
|
||||||
int precision = -1;
|
int precision = -1;
|
||||||
switch (have_width) {
|
switch (have_width) {
|
||||||
case false:
|
case false: {
|
||||||
// TODO: parse optional flags
|
// TODO: parse optional flags
|
||||||
for (bool stop = false; !stop;) {
|
bool stop = false;
|
||||||
|
do {
|
||||||
switch (*s) {
|
switch (*s) {
|
||||||
case '-':
|
case '-':
|
||||||
++s;
|
++s;
|
||||||
@ -677,7 +678,7 @@ void fmt::BasicWriter<Char>::PrintfParser::Format(
|
|||||||
default:
|
default:
|
||||||
stop = true;
|
stop = true;
|
||||||
}
|
}
|
||||||
}
|
} while (!stop);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Parse fill and alignment.
|
// Parse fill and alignment.
|
||||||
@ -740,6 +741,7 @@ void fmt::BasicWriter<Char>::PrintfParser::Format(
|
|||||||
if (*s < '0' || *s > '9')
|
if (*s < '0' || *s > '9')
|
||||||
break;
|
break;
|
||||||
spec.width_ = internal::ParseNonnegativeInt(s, error);
|
spec.width_ = internal::ParseNonnegativeInt(s, error);
|
||||||
|
}
|
||||||
// Fall through.
|
// Fall through.
|
||||||
default:
|
default:
|
||||||
if (spec.fill_ == '0') {
|
if (spec.fill_ == '0') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user