From 4f19e8623eeeff9876024b85030454afb2474b02 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 30 Aug 2019 11:02:35 -0400 Subject: [PATCH] Project: Eliminate local variable shadowing Eliminates trivial variable shadowing warnings. --- hecl/lib/Project.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/hecl/lib/Project.cpp b/hecl/lib/Project.cpp index 961e47566..57b167399 100644 --- a/hecl/lib/Project.cpp +++ b/hecl/lib/Project.cpp @@ -414,9 +414,11 @@ bool Project::cookPath(const ProjectPath& path, const hecl::MultiProgressPrinter } } else if (m_cookSpecs.empty()) { m_cookSpecs.reserve(m_compiledSpecs.size()); - for (const ProjectDataSpec& spec : m_compiledSpecs) - if (spec.active && spec.spec.m_factory) - m_cookSpecs.push_back(spec.spec.m_factory(*this, DataSpecTool::Cook)); + for (const ProjectDataSpec& projectSpec : m_compiledSpecs) { + if (projectSpec.active && projectSpec.spec.m_factory) { + m_cookSpecs.push_back(projectSpec.spec.m_factory(*this, DataSpecTool::Cook)); + } + } } /* Iterate complete directory/file/glob list */ @@ -444,17 +446,18 @@ bool Project::packagePath(const ProjectPath& path, const hecl::MultiProgressPrin /* Construct DataSpec instance for packaging */ const DataSpecEntry* specEntry = nullptr; if (spec) { - if (spec->m_factory) + if (spec->m_factory) { specEntry = spec; + } } else { bool foundPC = false; - for (const ProjectDataSpec& spec : m_compiledSpecs) { - if (spec.active && spec.spec.m_factory) { - if (hecl::StringUtils::EndsWith(spec.spec.m_name, _SYS_STR("-PC"))) { + for (const ProjectDataSpec& projectSpec : m_compiledSpecs) { + if (projectSpec.active && projectSpec.spec.m_factory) { + if (hecl::StringUtils::EndsWith(projectSpec.spec.m_name, _SYS_STR("-PC"))) { foundPC = true; - specEntry = &spec.spec; + specEntry = &projectSpec.spec; } else if (!foundPC) { - specEntry = &spec.spec; + specEntry = &projectSpec.spec; } } }