diff options
author | Alex Turbov <i.zaufi@gmail.com> | 2024-08-13 18:30:51 (GMT) |
---|---|---|
committer | Alex Turbov <i.zaufi@gmail.com> | 2024-08-13 21:16:34 (GMT) |
commit | 23be5302754253dc128b0aa9d3f3d884b546107e (patch) | |
tree | f2400678c35e19e21132551093543ba2bd081055 /Source/cmJSONHelpers.h | |
parent | 88e90fcd2056f14531db33f15980431cbbdf39fe (diff) | |
download | CMake-23be5302754253dc128b0aa9d3f3d884b546107e.zip CMake-23be5302754253dc128b0aa9d3f3d884b546107e.tar.gz CMake-23be5302754253dc128b0aa9d3f3d884b546107e.tar.bz2 |
cmJSONHelpers.h: Move variable declaation close to first usage
Diffstat (limited to 'Source/cmJSONHelpers.h')
-rw-r--r-- | Source/cmJSONHelpers.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmJSONHelpers.h b/Source/cmJSONHelpers.h index 368a0df..cf10080 100644 --- a/Source/cmJSONHelpers.h +++ b/Source/cmJSONHelpers.h @@ -104,7 +104,6 @@ struct cmJSONHelperBuilder bool operator()(T& out, const Json::Value* value, cmJSONState* state) const { Json::Value::Members extraFields; - bool success = true; if (!value && this->AnyRequired) { Error(JsonErrors::ObjectError::RequiredMissing, extraFields)(value, state); @@ -125,6 +124,7 @@ struct cmJSONHelperBuilder extraFields.end()); } + bool success = true; for (auto const& m : this->Members) { std::string name(m.Name.data(), m.Name.size()); state->push_stack(name, value); @@ -332,7 +332,6 @@ struct cmJSONHelperBuilder return [error, func, filter](std::map<std::string, T>& out, const Json::Value* value, cmJSONState* state) -> bool { - bool success = true; if (!value) { out.clear(); return true; @@ -343,6 +342,7 @@ struct cmJSONHelperBuilder return false; } out.clear(); + bool success = true; for (auto const& key : value->getMemberNames()) { state->push_stack(cmStrCat(key, ""), &(*value)[key]); if (!filter(key)) { |