diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 4311853..90b4fdb 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -1915,7 +1915,6 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const Json::Value my_invalid; if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL Json::Value& inv = *invalid; - bool valid = true; std::set valid_keys; getValidReaderKeys(&valid_keys); Value::Members keys = settings_.getMemberNames(); @@ -1926,7 +1925,7 @@ bool CharReaderBuilder::validate(Json::Value* invalid) const inv[key] = settings_[key]; } } - return valid; + return 0u == inv.size(); } // static void CharReaderBuilder::strictMode(Json::Value* settings) diff --git a/src/lib_json/json_writer.cpp b/src/lib_json/json_writer.cpp index f7c630d..9dbe53e 100644 --- a/src/lib_json/json_writer.cpp +++ b/src/lib_json/json_writer.cpp @@ -1110,7 +1110,6 @@ bool StreamWriterBuilder::validate(Json::Value* invalid) const Json::Value my_invalid; if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL Json::Value& inv = *invalid; - bool valid = true; std::set valid_keys; getValidWriterKeys(&valid_keys); Value::Members keys = settings_.getMemberNames(); @@ -1121,7 +1120,7 @@ bool StreamWriterBuilder::validate(Json::Value* invalid) const inv[key] = settings_[key]; } } - return valid; + return 0u == inv.size(); } // static void StreamWriterBuilder::setDefaults(Json::Value* settings)