diff --git a/include/nlohmann/detail/view/builder.hpp b/include/nlohmann/detail/view/builder.hpp index 283cae075..938d6d73b 100644 --- a/include/nlohmann/detail/view/builder.hpp +++ b/include/nlohmann/detail/view/builder.hpp @@ -1174,9 +1174,8 @@ indent_done: { ++p; } - else if (!negative || NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9')) + else if (NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9')) { - // (without a sign, the dispatch saw a digit) p = skip_digits(p + 1, e); } else diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index 1c6cd6cef..405e272a6 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -2479,9 +2479,8 @@ indent_done: { ++p; } - else if (!negative || NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9')) + else if (NLOHMANN_VIEW_LIKELY(cur() >= '1' && cur() <= '9')) { - // (without a sign, the dispatch saw a digit) p = skip_digits(p + 1, e); } else