Simplify the decimal point condition in dump_float
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+2
-2
No files matched your search
@@ -2106,7 +2106,7 @@ class serializer
|
|||||||
const std::size_t decimal_point_len = std::char_traits<char>::length(decimal_point);
|
const std::size_t decimal_point_len = std::char_traits<char>::length(decimal_point);
|
||||||
|
|
||||||
// convert decimal point to '.'
|
// convert decimal point to '.'
|
||||||
if (decimal_point_len != 0 && !(decimal_point_len == 1 && decimal_point[0] == '.'))
|
if ((decimal_point_len > 1) || (decimal_point_len == 1 && decimal_point[0] != '.'))
|
||||||
{
|
{
|
||||||
const auto first = number_buffer.begin();
|
const auto first = number_buffer.begin();
|
||||||
const auto last = first + len;
|
const auto last = first + len;
|
||||||
|
|||||||
Generated
+1
-1
@@ -37353,7 +37353,7 @@ class serializer
|
|||||||
const std::size_t decimal_point_len = std::char_traits<char>::length(decimal_point);
|
const std::size_t decimal_point_len = std::char_traits<char>::length(decimal_point);
|
||||||
|
|
||||||
// convert decimal point to '.'
|
// convert decimal point to '.'
|
||||||
if (decimal_point_len != 0 && !(decimal_point_len == 1 && decimal_point[0] == '.'))
|
if ((decimal_point_len > 1) || (decimal_point_len == 1 && decimal_point[0] != '.'))
|
||||||
{
|
{
|
||||||
const auto first = number_buffer.begin();
|
const auto first = number_buffer.begin();
|
||||||
const auto last = first + len;
|
const auto last = first + len;
|
||||||
|
|||||||
Reference in new issue
Block a user