json_view: no constant operand in the number dispatch (MSVC C4127)

The `!negative ||` that #6006 added to the digit test of the number scan has
a constant left operand in the template (negative is a template argument), so
MSVC reports C4127 under /WX in builder.hpp(1177). Restore the plain test; the
branch behaves the same.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-11-02 19:12:26 +01:00
1 parent 3724295333
commit eaee875178
2 files changed
+2 -4

No files matched your search

+1 -2
View File
@@ -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