ToolChains: Check typeId first before doing expensive checks

This should speed up toolchain auto-detection a lot.

Change-Id: Id732ed359a4c9de1d49cb658cc91c2e7c9d1b7a6
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Tobias Hunger
2015-10-30 13:30:08 +01:00
parent 30cdff7129
commit 88bbf4d126
3 changed files with 21 additions and 11 deletions

View File

@@ -356,8 +356,8 @@ static AndroidToolChain *findToolChain(Utils::FileName &compilerPath, const QLis
{
return static_cast<AndroidToolChain *>(
Utils::findOrDefault(alreadyKnown, [compilerPath](ToolChain *tc) {
return tc->compilerCommand() == compilerPath
&& tc->typeId() == Constants::ANDROID_TOOLCHAIN_ID;
return tc->typeId() == Constants::ANDROID_TOOLCHAIN_ID
&& tc->compilerCommand() == compilerPath;
}));
}