Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
json
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
json
Commits
80cf9d70
Unverified
Commit
80cf9d70
authored
Oct 16, 2021
by
Niels Lohmann
Committed by
GitHub
Oct 16, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert invalid fix (#3082)
*
⏪
revert invalid fix
parent
ba046e4e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
include/nlohmann/detail/output/serializer.hpp
include/nlohmann/detail/output/serializer.hpp
+4
-3
single_include/nlohmann/json.hpp
single_include/nlohmann/json.hpp
+4
-3
No files found.
include/nlohmann/detail/output/serializer.hpp
View file @
80cf9d70
...
@@ -811,8 +811,8 @@ class serializer
...
@@ -811,8 +811,8 @@ class serializer
// erase thousands separator
// erase thousands separator
if
(
thousands_sep
!=
'\0'
)
if
(
thousands_sep
!=
'\0'
)
{
{
auto
*
const
end
=
std
::
remove
(
number_buffer
.
begin
(),
// NOLINTNEXTLINE(readability-qualified-auto,llvm-qualified-auto): std::remove returns an iterator, see https://github.com/nlohmann/json/issues/3081
number_buffer
.
begin
()
+
len
,
thousands_sep
);
const
auto
end
=
std
::
remove
(
number_buffer
.
begin
(),
number_buffer
.
begin
()
+
len
,
thousands_sep
);
std
::
fill
(
end
,
number_buffer
.
end
(),
'\0'
);
std
::
fill
(
end
,
number_buffer
.
end
(),
'\0'
);
JSON_ASSERT
((
end
-
number_buffer
.
begin
())
<=
len
);
JSON_ASSERT
((
end
-
number_buffer
.
begin
())
<=
len
);
len
=
(
end
-
number_buffer
.
begin
());
len
=
(
end
-
number_buffer
.
begin
());
...
@@ -821,7 +821,8 @@ class serializer
...
@@ -821,7 +821,8 @@ class serializer
// convert decimal point to '.'
// convert decimal point to '.'
if
(
decimal_point
!=
'\0'
&&
decimal_point
!=
'.'
)
if
(
decimal_point
!=
'\0'
&&
decimal_point
!=
'.'
)
{
{
auto
*
const
dec_pos
=
std
::
find
(
number_buffer
.
begin
(),
number_buffer
.
end
(),
decimal_point
);
// NOLINTNEXTLINE(readability-qualified-auto,llvm-qualified-auto): std::find returns an iterator, see https://github.com/nlohmann/json/issues/3081
const
auto
dec_pos
=
std
::
find
(
number_buffer
.
begin
(),
number_buffer
.
end
(),
decimal_point
);
if
(
dec_pos
!=
number_buffer
.
end
())
if
(
dec_pos
!=
number_buffer
.
end
())
{
{
*
dec_pos
=
'.'
;
*
dec_pos
=
'.'
;
...
...
single_include/nlohmann/json.hpp
View file @
80cf9d70
...
@@ -17235,8 +17235,8 @@ class serializer
...
@@ -17235,8 +17235,8 @@ class serializer
// erase thousands separator
// erase thousands separator
if
(
thousands_sep
!=
'\0'
)
if
(
thousands_sep
!=
'\0'
)
{
{
auto
*
const
end
=
std
::
remove
(
number_buffer
.
begin
(),
// NOLINTNEXTLINE(readability-qualified-auto,llvm-qualified-auto): std::remove returns an iterator, see https://github.com/nlohmann/json/issues/3081
number_buffer
.
begin
()
+
len
,
thousands_sep
);
const
auto
end
=
std
::
remove
(
number_buffer
.
begin
(),
number_buffer
.
begin
()
+
len
,
thousands_sep
);
std
::
fill
(
end
,
number_buffer
.
end
(),
'\0'
);
std
::
fill
(
end
,
number_buffer
.
end
(),
'\0'
);
JSON_ASSERT
((
end
-
number_buffer
.
begin
())
<=
len
);
JSON_ASSERT
((
end
-
number_buffer
.
begin
())
<=
len
);
len
=
(
end
-
number_buffer
.
begin
());
len
=
(
end
-
number_buffer
.
begin
());
...
@@ -17245,7 +17245,8 @@ class serializer
...
@@ -17245,7 +17245,8 @@ class serializer
// convert decimal point to '.'
// convert decimal point to '.'
if
(
decimal_point
!=
'\0'
&&
decimal_point
!=
'.'
)
if
(
decimal_point
!=
'\0'
&&
decimal_point
!=
'.'
)
{
{
auto
*
const
dec_pos
=
std
::
find
(
number_buffer
.
begin
(),
number_buffer
.
end
(),
decimal_point
);
// NOLINTNEXTLINE(readability-qualified-auto,llvm-qualified-auto): std::find returns an iterator, see https://github.com/nlohmann/json/issues/3081
const
auto
dec_pos
=
std
::
find
(
number_buffer
.
begin
(),
number_buffer
.
end
(),
decimal_point
);
if
(
dec_pos
!=
number_buffer
.
end
())
if
(
dec_pos
!=
number_buffer
.
end
())
{
{
*
dec_pos
=
'.'
;
*
dec_pos
=
'.'
;
...
...
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