CMake: Avoid redundant copy

Amends commit e8802d92e3.

Reported by Coverity.

Change-Id: Ibc0b1cdf1918d5bfed5104f14098096d158526e2
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Orgad Shaneh
2023-02-21 08:57:39 +02:00
committed by Orgad Shaneh
parent 55760cb5f7
commit a5e98b1fa0

View File

@@ -545,7 +545,7 @@ ToolChain *findExternalToolchain(const QString &presetArchitecture, const QStrin
};
Abi::OSFlavor toolsetAbi = Abi::UnknownFlavor;
for (auto abiPair : abiTable) {
for (const auto &abiPair : abiTable) {
if (presetToolset.contains(abiPair.first)) {
toolsetAbi = abiPair.second;
break;
@@ -554,7 +554,7 @@ ToolChain *findExternalToolchain(const QString &presetArchitecture, const QStrin
// User didn't specify any flavor, so pick the highest toolchain available
if (toolsetAbi == Abi::UnknownFlavor) {
for (auto abiPair : abiTable) {
for (const auto &abiPair : abiTable) {
if (msvcFlavors.contains(abiPair.second)) {
toolsetAbi = abiPair.second;
break;