Applied readability-use-anyofallof clang-tidy fixes
This commit is contained in:
@@ -239,17 +239,14 @@ void diagram::get_parents(
|
||||
bool diagram::has_element(
|
||||
clanguml::common::model::diagram_element::id_t id) const
|
||||
{
|
||||
for (const auto &c : classes_) {
|
||||
if (c.get().id() == id)
|
||||
return true;
|
||||
}
|
||||
const auto has_class = std::any_of(classes_.begin(), classes_.end(),
|
||||
[id](const auto &c) { return c.get().id() == id; });
|
||||
|
||||
for (const auto &c : enums_) {
|
||||
if (c.get().id() == id)
|
||||
if (has_class)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return std::any_of(enums_.begin(), enums_.end(),
|
||||
[id](const auto &c) { return c.get().id() == id; });
|
||||
}
|
||||
|
||||
std::string diagram::to_alias(
|
||||
|
||||
@@ -238,12 +238,8 @@ bool is_subexpr_of(const clang::Stmt *parent_stmt, const clang::Stmt *sub_stmt)
|
||||
if (parent_stmt == sub_stmt)
|
||||
return true;
|
||||
|
||||
for (const auto *e : parent_stmt->children()) {
|
||||
if (is_subexpr_of(e, sub_stmt))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return std::any_of(parent_stmt->child_begin(), parent_stmt->child_end(),
|
||||
[sub_stmt](const auto *e) { return is_subexpr_of(e, sub_stmt); });
|
||||
}
|
||||
|
||||
template <> id_t to_id(const std::string &full_name)
|
||||
|
||||
@@ -22,20 +22,19 @@ namespace clanguml::common::model {
|
||||
|
||||
bool decorated_element::skip() const
|
||||
{
|
||||
for (auto d : decorators_)
|
||||
if (std::dynamic_pointer_cast<decorators::skip>(d))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return std::any_of(
|
||||
decorators_.begin(), decorators_.end(), [](const auto &d) {
|
||||
return std::dynamic_pointer_cast<decorators::skip>(d) != nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
bool decorated_element::skip_relationship() const
|
||||
{
|
||||
for (auto d : decorators_)
|
||||
if (std::dynamic_pointer_cast<decorators::skip_relationship>(d))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return std::any_of(
|
||||
decorators_.begin(), decorators_.end(), [](const auto &d) {
|
||||
return std::dynamic_pointer_cast<decorators::skip_relationship>(
|
||||
d) != nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
std::pair<relationship_t, std::string>
|
||||
|
||||
Reference in New Issue
Block a user