提交 50888671 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Upgrade C++ json dep to 3.7.3

上级 1d24755c
...@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1) ...@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1)
## PROJECT ## PROJECT
## name and version ## name and version
## ##
project(nlohmann_json VERSION 3.7.2 LANGUAGES CXX) project(nlohmann_json VERSION 3.7.3 LANGUAGES CXX)
## ##
## INCLUDE ## INCLUDE
......
# Change Log # Change Log
All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
## [v3.7.3](https://github.com/nlohmann/json/releases/tag/v3.7.3) (2019-11-17)
[Full Changelog](https://github.com/nlohmann/json/compare/v3.7.2...v3.7.3)
- Project branches [\#1839](https://github.com/nlohmann/json/issues/1839)
- Quadratic destruction complexity introduced in \#1436 [\#1837](https://github.com/nlohmann/json/issues/1837)
- Trying to open a file [\#1814](https://github.com/nlohmann/json/issues/1814)
- Comparing data type with value\_t::number\_integer fails [\#1783](https://github.com/nlohmann/json/issues/1783)
- CMake version config file is architecture-dependent [\#1697](https://github.com/nlohmann/json/issues/1697)
- Fix quadratic destruction complexity [\#1838](https://github.com/nlohmann/json/pull/1838) ([nickaein](https://github.com/nickaein))
## [v3.7.2](https://github.com/nlohmann/json/releases/tag/v3.7.2) (2019-11-10) ## [v3.7.2](https://github.com/nlohmann/json/releases/tag/v3.7.2) (2019-11-10)
[Full Changelog](https://github.com/nlohmann/json/compare/v3.7.1...v3.7.2) [Full Changelog](https://github.com/nlohmann/json/compare/v3.7.1...v3.7.2)
......
/* /*
__ _____ _____ _____ __ _____ _____ _____
__| | __| | | | JSON for Modern C++ __| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.7.2 | | |__ | | | | | | version 3.7.3
|_____|_____|_____|_|___| https://github.com/nlohmann/json |_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License <http://opensource.org/licenses/MIT>. Licensed under the MIT License <http://opensource.org/licenses/MIT>.
...@@ -32,7 +32,7 @@ SOFTWARE. ...@@ -32,7 +32,7 @@ SOFTWARE.
#define NLOHMANN_JSON_VERSION_MAJOR 3 #define NLOHMANN_JSON_VERSION_MAJOR 3
#define NLOHMANN_JSON_VERSION_MINOR 7 #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 <algorithm> // all_of, find, for_each
#include <cassert> // assert #include <cassert> // assert
...@@ -953,7 +953,7 @@ class basic_json ...@@ -953,7 +953,7 @@ class basic_json
object = nullptr; // silence warning, see #821 object = nullptr; // silence warning, see #821
if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) 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; break;
} }
...@@ -1010,14 +1010,13 @@ class basic_json ...@@ -1010,14 +1010,13 @@ class basic_json
else if (t == value_t::object) else if (t == value_t::object)
{ {
stack.reserve(object->size()); stack.reserve(object->size());
for (auto&& it : *object) for (auto&& it : *object)
{ {
stack.push_back(std::move(it.second)); stack.push_back(std::move(it.second));
} }
} }
while (!stack.empty()) while (not stack.empty())
{ {
// move the last item to local variable to be processed // move the last item to local variable to be processed
basic_json current_item(std::move(stack.back())); basic_json current_item(std::move(stack.back()));
...@@ -1027,8 +1026,6 @@ class basic_json ...@@ -1027,8 +1026,6 @@ class basic_json
// its children to the stack to be processed later // its children to the stack to be processed later
if (current_item.is_array()) 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::move(current_item.m_value.array->begin(), current_item.m_value.array->end(),
std::back_inserter(stack)); std::back_inserter(stack));
...@@ -1036,15 +1033,16 @@ class basic_json ...@@ -1036,15 +1033,16 @@ class basic_json
} }
else if (current_item.is_object()) else if (current_item.is_object())
{ {
stack.reserve(stack.size() + current_item.m_value.object->size());
for (auto&& it : *current_item.m_value.object) for (auto&& it : *current_item.m_value.object)
{ {
stack.push_back(std::move(it.second)); 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) switch (t)
......
project('nlohmann_json', project('nlohmann_json',
'cpp', 'cpp',
version : '3.7.2', version : '3.7.3',
license : 'MIT', license : 'MIT',
) )
......
/* /*
__ _____ _____ _____ __ _____ _____ _____
__| | __| | | | JSON for Modern C++ __| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.7.2 | | |__ | | | | | | version 3.7.3
|_____|_____|_____|_|___| https://github.com/nlohmann/json |_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License <http://opensource.org/licenses/MIT>. Licensed under the MIT License <http://opensource.org/licenses/MIT>.
...@@ -32,7 +32,7 @@ SOFTWARE. ...@@ -32,7 +32,7 @@ SOFTWARE.
#define NLOHMANN_JSON_VERSION_MAJOR 3 #define NLOHMANN_JSON_VERSION_MAJOR 3
#define NLOHMANN_JSON_VERSION_MINOR 7 #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 <algorithm> // all_of, find, for_each
#include <cassert> // assert #include <cassert> // assert
...@@ -15496,7 +15496,7 @@ class basic_json ...@@ -15496,7 +15496,7 @@ class basic_json
object = nullptr; // silence warning, see #821 object = nullptr; // silence warning, see #821
if (JSON_HEDLEY_UNLIKELY(t == value_t::null)) 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; break;
} }
...@@ -15553,14 +15553,13 @@ class basic_json ...@@ -15553,14 +15553,13 @@ class basic_json
else if (t == value_t::object) else if (t == value_t::object)
{ {
stack.reserve(object->size()); stack.reserve(object->size());
for (auto&& it : *object) for (auto&& it : *object)
{ {
stack.push_back(std::move(it.second)); stack.push_back(std::move(it.second));
} }
} }
while (!stack.empty()) while (not stack.empty())
{ {
// move the last item to local variable to be processed // move the last item to local variable to be processed
basic_json current_item(std::move(stack.back())); basic_json current_item(std::move(stack.back()));
...@@ -15570,8 +15569,6 @@ class basic_json ...@@ -15570,8 +15569,6 @@ class basic_json
// its children to the stack to be processed later // its children to the stack to be processed later
if (current_item.is_array()) 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::move(current_item.m_value.array->begin(), current_item.m_value.array->end(),
std::back_inserter(stack)); std::back_inserter(stack));
...@@ -15579,15 +15576,16 @@ class basic_json ...@@ -15579,15 +15576,16 @@ class basic_json
} }
else if (current_item.is_object()) else if (current_item.is_object())
{ {
stack.reserve(stack.size() + current_item.m_value.object->size());
for (auto&& it : *current_item.m_value.object) for (auto&& it : *current_item.m_value.object)
{ {
stack.push_back(std::move(it.second)); 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) switch (t)
......
...@@ -55,7 +55,7 @@ function get_gyp() ...@@ -55,7 +55,7 @@ function get_gyp()
function get_json() function get_json()
{ {
GIT_REPO="https://github.com/nlohmann/json.git" GIT_REPO="https://github.com/nlohmann/json.git"
GIT_TAG="v3.7.2" GIT_TAG="v3.7.3"
DEST="deps/json" DEST="deps/json"
get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}" get_dep "${GIT_REPO}" "${GIT_TAG}" "${DEST}"
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论