fix Builders::validate()

This commit is contained in:
Christopher Dunn 2015-03-04 14:59:16 -06:00
parent 99822b27cd
commit 626cfcdbb8
2 changed files with 2 additions and 4 deletions

View File

@ -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<std::string> 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)

View File

@ -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<std::string> 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)