Fixed clang-tidy warnings
This commit is contained in:
@@ -42,7 +42,8 @@ void diagram_element::set_parent_element_id(common::id_t id)
|
||||
|
||||
std::string diagram_element::alias() const
|
||||
{
|
||||
assert(id_.value() >= 0);
|
||||
// Only generate alias for global id's
|
||||
assert(id_.is_global());
|
||||
|
||||
return fmt::format("C_{:022}", id_.value());
|
||||
}
|
||||
|
||||
@@ -744,11 +744,11 @@ void generator::generate_diagram(nlohmann::json &parent) const
|
||||
for (const auto &to_location : config().to()) {
|
||||
auto to_activity_id = model().get_to_activity_id(to_location);
|
||||
|
||||
if (to_activity_id == 0)
|
||||
if (!to_activity_id.has_value())
|
||||
continue;
|
||||
|
||||
auto message_chains_unique = model().get_all_from_to_message_chains(
|
||||
common::id_t{}, *to_activity_id);
|
||||
common::id_t{}, to_activity_id.value());
|
||||
|
||||
nlohmann::json sequence;
|
||||
sequence["to"]["location"] = to_location.location;
|
||||
|
||||
@@ -178,7 +178,7 @@ std::string method::method_name() const { return method_name_; }
|
||||
|
||||
std::string method::alias() const
|
||||
{
|
||||
assert(class_id_.value() >= 0);
|
||||
assert(class_id_.is_global());
|
||||
|
||||
return fmt::format("C_{:022}", class_id_.value());
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void call_expression_context::update(
|
||||
common::id_t call_expression_context::caller_id() const
|
||||
{
|
||||
if (lambda_caller_id().has_value())
|
||||
return *lambda_caller_id();
|
||||
return *lambda_caller_id(); // NOLINT
|
||||
|
||||
return current_caller_id_;
|
||||
}
|
||||
|
||||
@@ -1934,11 +1934,11 @@ std::string translation_unit_visitor::make_lambda_name(
|
||||
// Parent is also a lambda (this id points to a lambda operator())
|
||||
std::string parent_lambda_class_name{"()"};
|
||||
if (diagram().get_participant<model::method>(
|
||||
context().lambda_caller_id().value())) {
|
||||
context().lambda_caller_id().value())) { // NOLINT
|
||||
auto parent_lambda_class_id =
|
||||
diagram()
|
||||
.get_participant<model::method>(
|
||||
context().lambda_caller_id().value())
|
||||
context().lambda_caller_id().value()) // NOLINT
|
||||
.value()
|
||||
.class_id();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user