Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
7766bc25
Commit
7766bc25
authored
Apr 12, 2020
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated fmt_helper::pad2()
parent
34244656
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
11 deletions
+2
-11
include/spdlog/details/fmt_helper.h
include/spdlog/details/fmt_helper.h
+2
-11
No files found.
include/spdlog/details/fmt_helper.h
View file @
7766bc25
...
...
@@ -39,21 +39,12 @@ inline unsigned int count_digits(T n)
inline
void
pad2
(
int
n
,
memory_buf_t
&
dest
)
{
if
(
n
>
99
)
{
append_int
(
n
,
dest
);
}
else
if
(
n
>
9
)
// 10-99
if
(
n
>=
0
&&
n
<
100
)
// 0-99
{
dest
.
push_back
(
static_cast
<
char
>
(
'0'
+
n
/
10
));
dest
.
push_back
(
static_cast
<
char
>
(
'0'
+
n
%
10
));
}
else
if
(
n
>=
0
)
// 0-9
{
dest
.
push_back
(
'0'
);
dest
.
push_back
(
static_cast
<
char
>
(
'0'
+
n
));
}
else
// negatives (unlikely, but just in case, let fmt deal with it)
else
// unlikely, but just in case, let fmt deal with it
{
fmt
::
format_to
(
dest
,
"{:02}"
,
n
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment