Debugger: Simplify code a little

Change-Id: Ib259058973eff47e730f4354f2feaaccc3029746
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-03-01 21:32:03 +01:00
parent 8da98c44f1
commit ee4874e4ee

View File

@@ -367,20 +367,20 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
if (!abis.isEmpty()) { if (!abis.isEmpty()) {
// Try exact abis. // Try exact abis.
m_kit = KitManager::find(KitMatcher(std::function<bool (const Kit *)>([abis](const Kit *k) -> bool { m_kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) if (const ToolChain *tc = ToolChainKitInformation::toolChain(k))
return abis.contains(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k); return abis.contains(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k);
return false; return false;
}))); }));
if (!m_kit) { if (!m_kit) {
// Or something compatible. // Or something compatible.
m_kit = KitManager::find(KitMatcher(std::function<bool (const Kit *)>([abis](const Kit *k) -> bool { m_kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
if (const ToolChain *tc = ToolChainKitInformation::toolChain(k)) if (const ToolChain *tc = ToolChainKitInformation::toolChain(k))
foreach (const Abi &a, abis) foreach (const Abi &a, abis)
if (a.isCompatibleWith(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k)) if (a.isCompatibleWith(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k))
return true; return true;
return false; return false;
}))); }));
} }
} }
} }