| 250 | } |
| 251 | |
| 252 | void Signature::PrepareNodes() { |
| 253 | nodes.resize(0); // Keep the storage. |
| 254 | |
| 255 | // Initialize the nodes. |
| 256 | int64_t mask = 1; |
| 257 | for (const auto& entry : map) { |
| 258 | SigNode* node = entry.second.get(); |
| 259 | node->last_hashed_nodes_ = node->node_mask_ = mask; |
| 260 | mask <<= 1; |
| 261 | node->unique_rank_ = ~0; |
| 262 | node->hash_is_final_ = false; |
| 263 | node->ComputeTopoHash0(); |
| 264 | if (node->GetHighTopoHash() <= map.size()) { |
| 265 | // Would conflict with one of the reserved values. |
| 266 | node->ReHighTopoHash(); |
| 267 | } |
| 268 | |
| 269 | // The initial order is random. |
| 270 | nodes.emplace_back(node); |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | void Signature::FindUniqueHashes(size_t* next_node_id_p) { |
| 275 | // Start by sorting by the hash value. |
nothing calls this directly
no test coverage detected