diff options
author | Brad King <brad.king@kitware.com> | 2014-06-16 15:44:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-06-23 13:14:43 (GMT) |
commit | e838e0a977bf3ca07509f4af39d5f93d598f84f4 (patch) | |
tree | de24493cdc8e85bca0f518f03299d20d8f813e6a /Source | |
parent | 7b85938973782ec6d09b1debe6ad48d3ba887683 (diff) | |
download | CMake-e838e0a977bf3ca07509f4af39d5f93d598f84f4.zip CMake-e838e0a977bf3ca07509f4af39d5f93d598f84f4.tar.gz CMake-e838e0a977bf3ca07509f4af39d5f93d598f84f4.tar.bz2 |
cmTarget: Simplify processILibs implementation
Combine the outer two if() conditions into a single one with &&.
Scope inner lookup result inside its condition.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 23 |
1 files 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<cmTarget*>& tgts, std::set<cmTarget*>& 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<std::string>::const_iterator + it = iface->Libraries.begin(); + it != iface->Libraries.end(); ++it) { - for(std::vector<std::string>::const_iterator - it = iface->Libraries.begin(); - it != iface->Libraries.end(); ++it) - { - processILibs(config, headTarget, *it, tgts, emitted); - } + processILibs(config, headTarget, *it, tgts, emitted); } } } |