Cleaned up code

This commit is contained in:
Bartek Kryza
2022-08-28 19:46:01 +02:00
parent 0701a082e9
commit feb19c23c7
10 changed files with 150 additions and 166 deletions

View File

@@ -59,6 +59,12 @@ void class_::add_method(class_method &&method)
void class_::add_parent(class_parent &&parent)
{
for (const auto &p : bases_) {
if (p.id() == parent.id()) {
return;
}
}
bases_.emplace_back(std::move(parent));
}
@@ -85,12 +91,7 @@ void class_::set_base_template(const std::string &full_name)
std::string class_::base_template() const { return base_template_full_name_; }
bool operator==(const class_ &l, const class_ &r)
{
return l.id() == r.id();
//(l.name_and_ns() == r.name_and_ns()) &&
// (l.templates_ == r.templates_);
}
bool operator==(const class_ &l, const class_ &r) { return l.id() == r.id(); }
void class_::add_type_alias(type_alias &&ta)
{

View File

@@ -168,8 +168,6 @@ bool diagram::add_class(std::unique_ptr<class_> &&c)
auto id = cc.id();
if (!has_class(cc)) {
if (base_name == "cpp_function_parameter")
LOG_DBG("AAAAAAAAAAAAAAAAAAAAAAA");
if (add_element(ns, std::move(c)))
classes_.push_back(std::ref(cc));
@@ -219,8 +217,6 @@ void diagram::get_parents(
bool found_new{false};
for (const auto &parent : parents) {
for (const auto &pp : parent.get().parents()) {
LOG_DBG("=-=-=-=-=-=-= {} HAS PARENT {} [{}]",
parent.get().full_name(false), pp.name(), pp.id());
auto p = get_class(pp.id());
if (p.has_value()) {
@@ -228,9 +224,6 @@ void diagram::get_parents(
if (found)
found_new = true;
}
else {
LOG_DBG("=-=-=-=-=-=-= {} NOT FOUND IN DIAGRAM", pp.id());
}
}
}