Skip to content
Snippets Groups Projects
Commit 6fc745dd authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

assert pointer not null

parent 4146d8bc
No related branches found
No related tags found
1 merge request!454Further changes suggested by clang-tidy
......@@ -51,10 +51,11 @@ template <typename T> const T* OnlyChildOfType(const INode& node)
template <typename T> std::vector<const T*> AllDescendantsOfType(const INode& node)
{
std::vector<const T*> result;
for (const auto* p_child : node.getChildren()) {
if (const auto* t = dynamic_cast<const T*>(p_child))
for (const auto* child : node.getChildren()) {
ASSERT(child);
if (const auto* t = dynamic_cast<const T*>(child))
result.push_back(t);
for (const auto* t : AllDescendantsOfType<T>(*p_child))
for (const auto* t : AllDescendantsOfType<T>(*child))
result.push_back(t);
}
return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment