refactor: Fix readability-use-anyofallof

This commit is contained in:
Lars Toenning
2025-10-25 16:42:41 +02:00
parent 8a877e85b7
commit 3758b2b5b9
22 changed files with 90 additions and 184 deletions

View File

@@ -20,11 +20,7 @@ namespace swift::misc::network
bool CRoleList::hasAnyRole(const QStringList &roles) const
{
for (const QString &r : roles)
{
if (this->hasRole(r)) { return true; }
}
return false;
return std::any_of(roles.cbegin(), roles.cend(), [&](const QString &r) { return this->hasRole(r); });
}
CRoleList::CRoleList(const CSequence<CRole> &other) : CSequence<CRole>(other) {}