From e838e0a977bf3ca07509f4af39d5f93d598f84f4 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 16 Jun 2014 11:44:49 -0400 Subject: cmTarget: Simplify processILibs implementation Combine the outer two if() conditions into a single one with &&. Scope inner lookup result inside its condition. --- Source/cmTarget.cxx | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9d53fc2..ff4ded1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -6123,22 +6123,19 @@ void processILibs(const std::string& config, std::string const& name, std::vector& tgts, std::set& emitted) { - if (cmTarget* tgt = headTarget->GetMakefile() - ->FindTargetToUse(name)) + cmTarget* tgt = headTarget->GetMakefile() + ->FindTargetToUse(name); + if (tgt && emitted.insert(tgt).second) { - if (emitted.insert(tgt).second) + tgts.push_back(tgt); + if(cmTarget::LinkInterface const* iface = + tgt->GetLinkInterfaceLibraries(config, headTarget)) { - tgts.push_back(tgt); - cmTarget::LinkInterface const* iface = - tgt->GetLinkInterfaceLibraries(config, headTarget); - if (iface) + for(std::vector::const_iterator + it = iface->Libraries.begin(); + it != iface->Libraries.end(); ++it) { - for(std::vector::const_iterator - it = iface->Libraries.begin(); - it != iface->Libraries.end(); ++it) - { - processILibs(config, headTarget, *it, tgts, emitted); - } + processILibs(config, headTarget, *it, tgts, emitted); } } } -- cgit v0.12