Simplify the decimal point condition in dump_float

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-02 17:25:51 +01:00
1 parent 98cfd55317
commit 6aa10fd343
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);
// 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 last = first + len;
+1 -1
View File
@@ -37353,7 +37353,7 @@ class serializer
const std::size_t decimal_point_len = std::char_traits<char>::length(decimal_point);
// 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 last = first + len;