| 233 | } |
| 234 | |
| 235 | ClassNode* 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 | ////////////////////////////////////////////////////////////////////////////// |
no test coverage detected