| 994 | } |
| 995 | |
| 996 | int GenericClusterImpl::GetLevel(const TxGraphImpl& graph) const noexcept |
| 997 | { |
| 998 | // GetLevel() does not work for empty Clusters. |
| 999 | if (!Assume(!m_linearization.empty())) return -1; |
| 1000 | |
| 1001 | // Pick an arbitrary Entry that occurs in this Cluster. |
| 1002 | const auto& entry = graph.m_entries[m_mapping[m_linearization.front()]]; |
| 1003 | // See if there is a level whose Locator matches this Cluster, if so return that level. |
| 1004 | for (int level = 0; level < MAX_LEVELS; ++level) { |
| 1005 | if (entry.m_locator[level].cluster == this) return level; |
| 1006 | } |
| 1007 | // Given that we started with an Entry that occurs in this Cluster, one of its Locators must |
| 1008 | // point back to it. |
| 1009 | assert(false); |
| 1010 | return -1; |
| 1011 | } |
| 1012 | |
| 1013 | int SingletonClusterImpl::GetLevel(const TxGraphImpl& graph) const noexcept |
| 1014 | { |
no test coverage detected