mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-26 09:28:21 +00:00
Fix tests.
This commit is contained in:
parent
f28ecafe01
commit
90986824a4
@ -123,7 +123,7 @@ void Formatter::FormatInt(T value, FormatSpec spec) {
|
|||||||
sign = '+';
|
sign = '+';
|
||||||
++size;
|
++size;
|
||||||
}
|
}
|
||||||
size_t offset = buffer_.size();
|
size_t start = buffer_.size();
|
||||||
char *p = 0;
|
char *p = 0;
|
||||||
switch (spec.type) {
|
switch (spec.type) {
|
||||||
case 0: case 'd': {
|
case 0: case 'd': {
|
||||||
@ -179,13 +179,11 @@ void Formatter::FormatInt(T value, FormatSpec spec) {
|
|||||||
}
|
}
|
||||||
if (sign) {
|
if (sign) {
|
||||||
if ((spec.flags & ZERO_FLAG) != 0)
|
if ((spec.flags & ZERO_FLAG) != 0)
|
||||||
buffer_[offset++] = sign;
|
buffer_[start++] = sign;
|
||||||
else
|
else
|
||||||
*p-- = sign;
|
*p-- = sign;
|
||||||
}
|
}
|
||||||
char *start = &buffer_[offset];
|
std::fill(&buffer_[start], p + 1, spec.fill);
|
||||||
if (start != p)
|
|
||||||
std::fill(start, p + 1, spec.fill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user