Fixed clang-tidy warnings

This commit is contained in:
Bartek Kryza
2024-05-03 16:48:39 +02:00
parent 95d83345a5
commit ba4835b6bc
4 changed files with 14 additions and 18 deletions

View File

@@ -946,11 +946,8 @@ bool is_struct(const clang::NamedDecl *decl)
bool has_attr(const clang::FunctionDecl *decl, clang::attr::Kind function_attr)
{
for (const auto &attr : decl->attrs()) {
if (attr->getKind() == function_attr)
return true;
}
return false;
return std::any_of(decl->attrs().begin(), decl->attrs().end(),
[function_attr](
auto &&attr) { return attr->getKind() == function_attr; });
}
} // namespace clanguml::common