| 133 | |
| 134 | |
| 135 | uint BindingNode::depth() const |
| 136 | { |
| 137 | uint depth = 0; |
| 138 | if (m_foundBindingLoop) { |
| 139 | return std::numeric_limits<uint>::max(); // to be considered as infinity. |
| 140 | } |
| 141 | for (const auto &dependency : m_dependencies) { |
| 142 | uint depDepth = dependency->depth(); |
| 143 | if (depDepth == std::numeric_limits<uint>::max()) { |
| 144 | depth = depDepth; |
| 145 | break; |
| 146 | } else if (depDepth + 1 > depth) { |
| 147 | depth = depDepth + 1; |
| 148 | } |
| 149 | } |
| 150 | return depth; |
| 151 | } |