diff --git a/include/nlohmann/detail/view/edit.hpp b/include/nlohmann/detail/view/edit.hpp index ab9503577..c542c1141 100644 --- a/include/nlohmann/detail/view/edit.hpp +++ b/include/nlohmann/detail/view/edit.hpp @@ -49,7 +49,7 @@ struct first_true : 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) diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index 864b6e1e3..594708671 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -3835,7 +3835,7 @@ struct first_true : 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)