| 908 | } |
| 909 | |
| 910 | DUContext* DUContext::findContext(const CursorInRevision& position, DUContext* parent) const |
| 911 | { |
| 912 | ENSURE_CAN_READ |
| 913 | |
| 914 | if (!parent) |
| 915 | parent = const_cast<DUContext*>(this); |
| 916 | |
| 917 | for (DUContext* context : std::as_const(parent->m_dynamicData->m_childContexts)) { |
| 918 | if (context->range().contains(position)) { |
| 919 | DUContext* ret = findContext(position, context); |
| 920 | if (!ret) { |
| 921 | ret = context; |
| 922 | } |
| 923 | |
| 924 | return ret; |
| 925 | } |
| 926 | } |
| 927 | |
| 928 | return nullptr; |
| 929 | } |
| 930 | |
| 931 | bool DUContext::parentContextOf(DUContext* context) const |
| 932 | { |
no test coverage detected