mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 02:21:34 +08:00
Optimize fmt_helper::pad3()
This commit is contained in:
parent
0a14e491ab
commit
76389e057f
@ -73,9 +73,21 @@ inline void pad_uint(T n, unsigned int width, memory_buf_t &dest)
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline void pad3(T n, memory_buf_t &dest)
|
inline void pad3(T n, memory_buf_t &dest)
|
||||||
{
|
{
|
||||||
pad_uint(n, 3, dest);
|
if(n < 1000)
|
||||||
|
{
|
||||||
|
dest.push_back(n / 100 + '0');
|
||||||
|
n = n % 100;
|
||||||
|
dest.push_back((n / 10) + '0');
|
||||||
|
dest.push_back((n % 10) + '0');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
append_int(n, dest);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
inline void pad6(T n, memory_buf_t &dest)
|
inline void pad6(T n, memory_buf_t &dest)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user