Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
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
fmt
Commits
c8a8464f
Commit
c8a8464f
authored
Sep 12, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize buffer construction
parent
8cbfb6e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
include/fmt/core.h
include/fmt/core.h
+4
-2
No files found.
include/fmt/core.h
View file @
c8a8464f
...
...
@@ -365,6 +365,9 @@ class basic_buffer {
std
::
size_t
capacity_
;
protected:
// Don't initialize ptr_ since it is not accessed to save a few cycles.
basic_buffer
(
std
::
size_t
sz
)
FMT_NOEXCEPT
:
size_
(
sz
),
capacity_
(
sz
)
{}
basic_buffer
(
T
*
p
=
FMT_NULL
,
std
::
size_t
sz
=
0
,
std
::
size_t
cap
=
0
)
FMT_NOEXCEPT:
ptr_
(
p
),
size_
(
sz
),
capacity_
(
cap
)
{}
...
...
@@ -445,8 +448,7 @@ class container_buffer : public basic_buffer<typename Container::value_type> {
public:
explicit
container_buffer
(
Container
&
c
)
:
basic_buffer
<
typename
Container
::
value_type
>
(
&
c
[
0
],
c
.
size
(),
c
.
size
()),
container_
(
c
)
{}
:
basic_buffer
<
typename
Container
::
value_type
>
(
c
.
size
()),
container_
(
c
)
{}
};
struct
error_handler
{
...
...
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