2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 19:44:55 +00:00

Merge pull request #23 from lioncash/shadow

Project: Eliminate local variable shadowing
This commit is contained in:
2019-08-30 16:27:55 -07:00
committed by GitHub

View File

@@ -414,9 +414,11 @@ bool Project::cookPath(const ProjectPath& path, const hecl::MultiProgressPrinter
} }
} else if (m_cookSpecs.empty()) { } else if (m_cookSpecs.empty()) {
m_cookSpecs.reserve(m_compiledSpecs.size()); m_cookSpecs.reserve(m_compiledSpecs.size());
for (const ProjectDataSpec& spec : m_compiledSpecs) for (const ProjectDataSpec& projectSpec : m_compiledSpecs) {
if (spec.active && spec.spec.m_factory) if (projectSpec.active && projectSpec.spec.m_factory) {
m_cookSpecs.push_back(spec.spec.m_factory(*this, DataSpecTool::Cook)); m_cookSpecs.push_back(projectSpec.spec.m_factory(*this, DataSpecTool::Cook));
}
}
} }
/* Iterate complete directory/file/glob list */ /* Iterate complete directory/file/glob list */
@@ -444,17 +446,18 @@ bool Project::packagePath(const ProjectPath& path, const hecl::MultiProgressPrin
/* Construct DataSpec instance for packaging */ /* Construct DataSpec instance for packaging */
const DataSpecEntry* specEntry = nullptr; const DataSpecEntry* specEntry = nullptr;
if (spec) { if (spec) {
if (spec->m_factory) if (spec->m_factory) {
specEntry = spec; specEntry = spec;
}
} else { } else {
bool foundPC = false; bool foundPC = false;
for (const ProjectDataSpec& spec : m_compiledSpecs) { for (const ProjectDataSpec& projectSpec : m_compiledSpecs) {
if (spec.active && spec.spec.m_factory) { if (projectSpec.active && projectSpec.spec.m_factory) {
if (hecl::StringUtils::EndsWith(spec.spec.m_name, _SYS_STR("-PC"))) { if (hecl::StringUtils::EndsWith(projectSpec.spec.m_name, _SYS_STR("-PC"))) {
foundPC = true; foundPC = true;
specEntry = &spec.spec; specEntry = &projectSpec.spec;
} else if (!foundPC) { } else if (!foundPC) {
specEntry = &spec.spec; specEntry = &projectSpec.spec;
} }
} }
} }