cmTarget: Simplify processILibs implementation

Combine the outer two if() conditions into a single one with &&.
Scope inner lookup result inside its condition.
This commit is contained in:
Brad King 2014-06-16 11:44:49 -04:00
parent 7b85938973
commit e838e0a977
1 changed files with 10 additions and 13 deletions

View File

@ -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);
}
}
}