Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ include(FetchContent) FetchContent_Declare(json GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohman_json GIT_TAG v3.7.2) GIT_TAG v3.7.3) FetchContent_GetProperties(json) if(NOT json_POPULATED) Loading include/nlohmann/json.hpp +8 −10 Original line number Diff line number Diff line /* __ _____ _____ _____ __| | __| | | | JSON for Modern C++ | | |__ | | | | | | version 3.7.2 | | |__ | | | | | | version 3.7.3 |_____|_____|_____|_|___| https://github.com/nlohmann/json Licensed under the MIT License <http://opensource.org/licenses/MIT>. Loading Loading @@ -32,7 +32,7 @@ SOFTWARE. #define NLOHMANN_JSON_VERSION_MAJOR 3 #define NLOHMANN_JSON_VERSION_MINOR 7 #define NLOHMANN_JSON_VERSION_PATCH 2 #define NLOHMANN_JSON_VERSION_PATCH 3 #include <algorithm> // all_of, find, for_each #include <cassert> // assert Loading Loading @@ -15496,7 +15496,7 @@ class basic_json object = nullptr; // silence warning, see #821 if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.7.2")); // LCOV_EXCL_LINE JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.7.3")); // LCOV_EXCL_LINE } break; } Loading Loading @@ -15553,14 +15553,13 @@ class basic_json else if (t == value_t::object) { stack.reserve(object->size()); for (auto&& it : *object) { stack.push_back(std::move(it.second)); } } while (!stack.empty()) while (not stack.empty()) { // move the last item to local variable to be processed basic_json current_item(std::move(stack.back())); Loading @@ -15570,8 +15569,6 @@ class basic_json // its children to the stack to be processed later if (current_item.is_array()) { stack.reserve(stack.size() + current_item.m_value.array->size()); std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), std::back_inserter(stack)); Loading @@ -15579,15 +15576,16 @@ class basic_json } else if (current_item.is_object()) { stack.reserve(stack.size() + current_item.m_value.object->size()); for (auto&& it : *current_item.m_value.object) { stack.push_back(std::move(it.second)); } current_item.m_value.object->clear(); } // current_item is destroyed here // it's now safe that current_item get destructed // since it doesn't have any children } switch (t) Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ include(FetchContent) FetchContent_Declare(json GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohman_json GIT_TAG v3.7.2) GIT_TAG v3.7.3) FetchContent_GetProperties(json) if(NOT json_POPULATED) Loading
include/nlohmann/json.hpp +8 −10 Original line number Diff line number Diff line /* __ _____ _____ _____ __| | __| | | | JSON for Modern C++ | | |__ | | | | | | version 3.7.2 | | |__ | | | | | | version 3.7.3 |_____|_____|_____|_|___| https://github.com/nlohmann/json Licensed under the MIT License <http://opensource.org/licenses/MIT>. Loading Loading @@ -32,7 +32,7 @@ SOFTWARE. #define NLOHMANN_JSON_VERSION_MAJOR 3 #define NLOHMANN_JSON_VERSION_MINOR 7 #define NLOHMANN_JSON_VERSION_PATCH 2 #define NLOHMANN_JSON_VERSION_PATCH 3 #include <algorithm> // all_of, find, for_each #include <cassert> // assert Loading Loading @@ -15496,7 +15496,7 @@ class basic_json object = nullptr; // silence warning, see #821 if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) { JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.7.2")); // LCOV_EXCL_LINE JSON_THROW(other_error::create(500, "961c151d2e87f2686a955a9be24d316f1362bf21 3.7.3")); // LCOV_EXCL_LINE } break; } Loading Loading @@ -15553,14 +15553,13 @@ class basic_json else if (t == value_t::object) { stack.reserve(object->size()); for (auto&& it : *object) { stack.push_back(std::move(it.second)); } } while (!stack.empty()) while (not stack.empty()) { // move the last item to local variable to be processed basic_json current_item(std::move(stack.back())); Loading @@ -15570,8 +15569,6 @@ class basic_json // its children to the stack to be processed later if (current_item.is_array()) { stack.reserve(stack.size() + current_item.m_value.array->size()); std::move(current_item.m_value.array->begin(), current_item.m_value.array->end(), std::back_inserter(stack)); Loading @@ -15579,15 +15576,16 @@ class basic_json } else if (current_item.is_object()) { stack.reserve(stack.size() + current_item.m_value.object->size()); for (auto&& it : *current_item.m_value.object) { stack.push_back(std::move(it.second)); } current_item.m_value.object->clear(); } // current_item is destroyed here // it's now safe that current_item get destructed // since it doesn't have any children } switch (t)