From a5e98b1fa0017102f55875c0e84f00e082b58da7 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 21 Feb 2023 08:57:39 +0200 Subject: [PATCH] CMake: Avoid redundant copy Amends commit e8802d92e39. Reported by Coverity. Change-Id: Ibc0b1cdf1918d5bfed5104f14098096d158526e2 Reviewed-by: Cristian Adam --- src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp index 09adf7335ba..ce01fcdc6ba 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprojectimporter.cpp @@ -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;