diff --git a/include/nlohmann/detail/diagnostics_t.hpp b/include/nlohmann/detail/diagnostics_t.hpp index c9a1f46d5..4e943cad5 100644 --- a/include/nlohmann/detail/diagnostics_t.hpp +++ b/include/nlohmann/detail/diagnostics_t.hpp @@ -39,7 +39,7 @@ class diagnostics_t if (current->m_parent->m_value.array->operator[](i) == *current) { tokens.emplace_back(std::to_string(i)); - continue; + break; } } break; @@ -52,7 +52,7 @@ class diagnostics_t if (element.second == *current) { tokens.emplace_back(element.first.c_str()); - continue; + break; } } break; @@ -79,7 +79,7 @@ class diagnostics_t } private: - const BasicJsonType* m_j = static_cast(nullptr); + const BasicJsonType* m_j = nullptr; }; } // namespace detail diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index d434df940..6cb7dc1b9 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -2537,7 +2537,7 @@ class diagnostics_t if (current->m_parent->m_value.array->operator[](i) == *current) { tokens.emplace_back(std::to_string(i)); - continue; + break; } } break; @@ -2550,7 +2550,7 @@ class diagnostics_t if (element.second == *current) { tokens.emplace_back(element.first.c_str()); - continue; + break; } } break; @@ -2577,7 +2577,7 @@ class diagnostics_t } private: - const BasicJsonType* m_j = static_cast(nullptr); + const BasicJsonType* m_j = nullptr; }; } // namespace detail