Fixed removeIf

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-19 21:23:48 +03:00
parent c13a90540c
commit f6f0fbbd9f
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -214,7 +214,17 @@ Task::Ptr GetModDependenciesTask::prepareDependencyTask(const ModPlatform::Depen
auto dep = getOverride({ pDep->version.addonId, pDep->dependency.type }, provider.name);
if (dep.addonId != pDep->version.addonId) {
auto toRemoveID = pDep->version.addonId;
m_pack_dependencies.removeIf([toRemoveID](auto v) { return v->pack->addonId == toRemoveID; });
auto pred = [toRemoveID](auto v) { return v->pack->addonId == toRemoveID; };
#if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
m_pack_dependencies.removeIf(pred);
#else
for (auto it = m_pack_dependencies.begin(); it != m_pack_dependencies.end();)
if (pred(*it))
it = m_pack_dependencies.erase(it);
else
++it;
#endif
addTask(prepareDependencyTask(dep, provider.name, level));
} else
addTask(getProjectInfoTask(pDep));