Use const iterator with std::find_if where possible

Make the resulting interator const.

Change-Id: I4aadcfff35f6b1015e506bc75bcfc2a1f1be4d65
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2020-11-18 13:06:55 +01:00
parent 48c2afe157
commit b269066435
8 changed files with 17 additions and 17 deletions

View File

@@ -97,10 +97,10 @@ static QString quickTestSrcDir(const CppTools::CppModelManager *cppMM,
if (parts.size() > 0) {
const ProjectExplorer::Macros &macros = parts.at(0)->projectMacros;
auto found = std::find_if(
macros.begin(),
macros.end(),
macros.cbegin(),
macros.cend(),
[] (const ProjectExplorer::Macro &macro) { return macro.key == "QUICK_TEST_SOURCE_DIR"; });
if (found != macros.end()) {
if (found != macros.cend()) {
QByteArray result = found->value;
if (result.startsWith('"'))
result.remove(result.length() - 1, 1).remove(0, 1);