MCPcopy Create free account
hub / github.com/KDE/kdevelop / findSubClass

Method findSubClass

kdevplatform/language/classmodel/classmodelnode.cpp:235–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235ClassNode* ClassNode::findSubClass(const KDevelop::IndexedQualifiedIdentifier& a_id)
236{
237 // Make sure we have sub nodes.
238 performPopulateNode();
239
240 /// @todo This is slow - we go over all the sub identifiers but the assumption is that
241 /// this function call is rare and the list is not that long.
242 for (Node* item : std::as_const(m_subIdentifiers)) {
243 auto* classNode = dynamic_cast<ClassNode*>(item);
244 if (classNode == nullptr)
245 continue;
246
247 if (classNode->identifier() == a_id)
248 return classNode;
249 }
250
251 return nullptr;
252}
253
254//////////////////////////////////////////////////////////////////////////////
255//////////////////////////////////////////////////////////////////////////////

Callers 1

findClassNodeMethod · 0.80

Calls 1

identifierMethod · 0.45

Tested by

no test coverage detected