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
aeb6add3
Commit
aeb6add3
authored
Sep 09, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip strchr for the common case
parent
5614289d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
include/fmt/format.h
include/fmt/format.h
+3
-4
No files found.
include/fmt/format.h
View file @
aeb6add3
...
...
@@ -2139,11 +2139,11 @@ FMT_CONSTEXPR void parse_format_string(
Handler
&
handler_
;
}
write
{
handler
};
auto
begin
=
format_str
.
data
(),
end
=
begin
+
format_str
.
size
();
for
(;;
)
{
while
(
begin
!=
end
)
{
// Doing two passes with memchr (one for '{' and another for '}') is up to
// 2.5x faster than the naive one-pass implementation on big format strings.
const
Char
*
p
=
FMT_NULL
;
if
(
!
find
<
IS_CONSTEXPR
>
(
begin
,
end
,
'{'
,
p
))
const
Char
*
p
=
begin
;
if
(
*
begin
!=
'{'
&&
!
find
<
IS_CONSTEXPR
>
(
begin
,
end
,
'{'
,
p
))
return
write
(
begin
,
end
);
write
(
begin
,
p
);
++
p
;
...
...
@@ -2165,7 +2165,6 @@ FMT_CONSTEXPR void parse_format_string(
return
handler
.
on_error
(
"missing '}' in format string"
);
}
begin
=
pointer_from
(
it
)
+
1
;
if
(
begin
==
end
)
return
;
}
}
...
...
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