Fix build on older Apple Clang

Actually not sooo old.

compilationdbparser.cpp:172:34: error: redefinition of 'it'

Amends f3e164af4f

Change-Id: Ib3fc97b39921138d2a27bbe8f95c504c8823d09f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2024-06-06 08:10:18 +02:00
parent c49ec17d01
commit 451de5adb8
2 changed files with 8 additions and 8 deletions

View File

@@ -84,11 +84,11 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
// Cache mime check result for speed up
if (!isIgnored) {
if (auto it = m_mimeBinaryCache.get<std::optional<bool>>(
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto it = cache.find(mimeType.name());
if (it != cache.end())
return *it;
return {};
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto cache_it = cache.find(mimeType.name());
if (cache_it != cache.end())
return *cache_it;
return {};
})) {
isIgnored = *it;
} else {

View File

@@ -169,9 +169,9 @@ void CompilationDbParser::start()
if (!isIgnored) {
if (auto it = m_mimeBinaryCache.get<std::optional<bool>>(
[mimeType](const QHash<QString, bool> &cache) -> std::optional<bool> {
auto it = cache.find(mimeType.name());
if (it != cache.end())
return *it;
const auto cache_it = cache.find(mimeType.name());
if (cache_it != cache.end())
return *cache_it;
return {};
})) {
isIgnored = *it;