| 156 | } |
| 157 | |
| 158 | size_t Get(size_t key) { |
| 159 | auto pos = Data.find(key); |
| 160 | if (pos == Data.end()) { |
| 161 | ythrow yexception() << "Bad node walking order: trying to get node offset too early or too many times!"; |
| 162 | } |
| 163 | size_t result = pos->second; |
| 164 | if (ParentCounts.Dec(key) == 0) { |
| 165 | // We don't need this offset any more. |
| 166 | Data.erase(pos); |
| 167 | } |
| 168 | return result; |
| 169 | } |
| 170 | |
| 171 | private: |
| 172 | TTrieNodeCounts ParentCounts; |
no test coverage detected