mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refactor: Fix readability-use-anyofallof
This commit is contained in:
@@ -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) {}
|
||||
|
||||
Reference in New Issue
Block a user