diff --git a/libs/linglong/src/linglong/package_manager/package_task.h b/libs/linglong/src/linglong/package_manager/package_task.h index c86f761b1..cc1693f5f 100644 --- a/libs/linglong/src/linglong/package_manager/package_task.h +++ b/libs/linglong/src/linglong/package_manager/package_task.h @@ -171,28 +171,7 @@ class PackageTaskQueue : public QObject LINGLONG_TRACE("add new task"); static_assert(std::is_invocable_r_v, "mismatch function signature"); - auto exist = - std::any_of(m_taskQueue.begin(), m_taskQueue.end(), [&refs](const PackageTask &task) { - QStringList intersection; - std::set_intersection(refs.begin(), - refs.end(), - task.m_refs.begin(), - task.m_refs.end(), - std::back_inserter(intersection)); - if (intersection.empty()) { - return false; - } - - for (const auto &ref : intersection) { - qWarning() << "ref " << ref << " is operating by task " << task.taskID(); - } - - return true; - }); - - if (exist) { - return LINGLONG_ERR("ref conflict"); - } + auto &ref = m_taskQueue.emplace_back(conn, refs, std::forward(job), this); Q_EMIT taskAdded();