Skip to content

Commit

Permalink
Fix confusing variable name
Browse files Browse the repository at this point in the history
Summary: This variable is called `builtin_generators`, which made me thing it contains C++ model generators, but instead just contains all defined model generators. Let's fix the name to avoid confusion.

Reviewed By: yuhshin-oss

Differential Revision: D46557626

fbshipit-source-id: e0cc39b358595f0888806a1e13026eaf577f503c
  • Loading branch information
arthaud authored and facebook-github-bot committed Jun 8, 2023
1 parent e4b04cb commit c37d93e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/ModelGeneration.cpp
Expand Up @@ -123,7 +123,7 @@ ModelGeneratorResult ModelGeneration::run(
}
}

auto builtin_generators = make_model_generators(context);
auto generator_definitions = make_model_generators(context);
std::vector<std::unique_ptr<ModelGenerator>> model_generators;
const auto& configuration_entries = options.model_generators_configuration();

Expand All @@ -132,8 +132,8 @@ ModelGeneratorResult ModelGeneration::run(
const std::string& name = entry.name();
LOG(2, "Found model generator: `{}`", name);

auto iterator = builtin_generators.find(name);
if (iterator == builtin_generators.end()) {
auto iterator = generator_definitions.find(name);
if (iterator == generator_definitions.end()) {
bool generator_exists = std::any_of(
model_generators.begin(),
model_generators.end(),
Expand All @@ -143,7 +143,7 @@ ModelGeneratorResult ModelGeneration::run(
}
} else {
model_generators.push_back(std::move(iterator->second));
builtin_generators.erase(iterator);
generator_definitions.erase(iterator);
}
}

Expand Down

0 comments on commit c37d93e

Please sign in to comment.