Skip to content

Commit

Permalink
chore: optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Dec 13, 2023
1 parent 0e07603 commit abea867
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cxx-parser/cxx/terra/include/terra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,13 +208,16 @@ namespace terra
cpp_entity.parent().value().kind() != cppast::cpp_entity_kind::namespace_t)
{
parent_name = cpp_entity.parent().value().name();
// some cppast::cpp_entity_kind has no parent, but parent_name is not empty
// such as agora::util::CopyableAutoPtr
// we need to set parent_name to empty
if (base_node.name.compare(parent_name) == 0)
{
parent_name = "";
}
}

// some cppast::cpp_entity_kind has no parent, but parent_name is not empty
// such as agora::util::CopyableAutoPtr
// we need to set parent_name to empty
if (cpp_entity.parent().has_value() &&
base_node.name.compare(cpp_entity.parent().value().name()) == 0)
if (base_node.name.compare(cpp_entity.parent().value().name()) == 0)
{
parent_name = "";
}
Expand Down

0 comments on commit abea867

Please sign in to comment.