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
7e4bc945
Unverified
Commit
7e4bc945
authored
Oct 09, 2021
by
Roman-Koshelev
Committed by
GitHub
Oct 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speeding up write_significand() (#2499)
parent
26c1ca4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
include/fmt/format.h
include/fmt/format.h
+13
-7
No files found.
include/fmt/format.h
View file @
7e4bc945
...
@@ -1713,14 +1713,20 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
...
@@ -1713,14 +1713,20 @@ inline auto write_significand(Char* out, UInt significand, int significand_size,
int
integral_size
,
Char
decimal_point
)
->
Char
*
{
int
integral_size
,
Char
decimal_point
)
->
Char
*
{
if
(
!
decimal_point
)
if
(
!
decimal_point
)
return
format_decimal
(
out
,
significand
,
significand_size
).
end
;
return
format_decimal
(
out
,
significand
,
significand_size
).
end
;
auto
end
=
format_decimal
(
out
+
1
,
significand
,
significand_size
).
end
;
out
+=
significand_size
+
1
;
if
(
integral_size
==
1
)
{
Char
*
end
=
out
;
out
[
0
]
=
out
[
1
];
int
floating_size
=
significand_size
-
integral_size
;
}
else
{
for
(
int
i
=
floating_size
/
2
;
i
>
0
;
--
i
)
{
std
::
uninitialized_copy_n
(
out
+
1
,
integral_size
,
out
-=
2
;
make_checked
(
out
,
to_unsigned
(
integral_size
)));
copy2
(
out
,
digits2
(
significand
%
100
));
significand
/=
100
;
}
if
(
floating_size
%
2
!=
0
)
{
*--
out
=
static_cast
<
Char
>
(
'0'
+
significand
%
10
);
significand
/=
10
;
}
}
out
[
integral_size
]
=
decimal_point
;
*--
out
=
decimal_point
;
format_decimal
(
out
-
integral_size
,
significand
,
integral_size
);
return
end
;
return
end
;
}
}
...
...
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