json_view: use while in check_utf8_bytewise

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-10-29 07:43:42 +01:00
parent 87559f1dc5
commit d26ea85663
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -49,7 +49,7 @@ struct first_true<false, Conditions...> : std::integral_constant < int, 1 + firs
/// well-formed sequence can continue with (Unicode, Table 3-7).
NLOHMANN_VIEW_ALWAYS_INLINE void check_utf8_bytewise(const unsigned char* p, std::size_t n, std::size_t i)
{
for (; i < n;)
while (i < n)
{
const unsigned char c = p[i];
if (c < 0x80)
+1 -1
View File
@@ -3835,7 +3835,7 @@ struct first_true<false, Conditions...> : std::integral_constant < int, 1 + firs
/// well-formed sequence can continue with (Unicode, Table 3-7).
NLOHMANN_VIEW_ALWAYS_INLINE void check_utf8_bytewise(const unsigned char* p, std::size_t n, std::size_t i)
{
for (; i < n;)
while (i < n)
{
const unsigned char c = p[i];
if (c < 0x80)