Don't shadow "schema" with local variables of the same name

This fixes a warning from gcc (-Wshadow).
This commit is contained in:
Mark Marshall 2020-08-17 15:51:14 +02:00
parent 1ad9a10b0b
commit 4dfb6bdb62

View File

@ -145,8 +145,8 @@ public:
void insert(const json_uri &uri, const std::shared_ptr<schema> &s) void insert(const json_uri &uri, const std::shared_ptr<schema> &s)
{ {
auto &file = get_or_create_file(uri.location()); auto &file = get_or_create_file(uri.location());
auto schema = file.schemas.lower_bound(uri.fragment()); auto xschema = file.schemas.lower_bound(uri.fragment());
if (schema != file.schemas.end() && !(file.schemas.key_comp()(uri.fragment(), schema->first))) { if (xschema != file.schemas.end() && !(file.schemas.key_comp()(uri.fragment(), xschema->first))) {
throw std::invalid_argument("schema with " + uri.to_string() + " already inserted"); throw std::invalid_argument("schema with " + uri.to_string() + " already inserted");
return; return;
} }
@ -185,9 +185,9 @@ public:
auto &file = get_or_create_file(uri.location()); auto &file = get_or_create_file(uri.location());
// existing schema // existing schema
auto schema = file.schemas.find(uri.fragment()); auto xschema = file.schemas.find(uri.fragment());
if (schema != file.schemas.end()) if (xschema != file.schemas.end())
return schema->second; return xschema->second;
// referencing an unknown keyword, turn it into schema // referencing an unknown keyword, turn it into schema
// //
@ -216,10 +216,10 @@ public:
} }
} }
void set_root_schema(json schema) void set_root_schema(json aschema)
{ {
files_.clear(); files_.clear();
root_ = schema::make(schema, this, {}, {{"#"}}); root_ = schema::make(aschema, this, {}, {{"#"}});
// load all files which have not yet been loaded // load all files which have not yet been loaded
do { do {