Iterate over all live nodes with their current ids.
(&self)
| 396 | }; |
| 397 | if !name_empty { |
| 398 | self.name_index.entry(name_hash).or_default().push(id); |
| 399 | } |
| 400 | // Read tags from the stored node. Building a temporary Vec<TagID> here |
| 401 | // made every tagged insert allocate once before the real index update. |
| 402 | let index = id.index() as usize; |
| 403 | for tag_index in 0..self.nodes[index].as_ref().map_or(0, |node| node.tags.len()) { |
| 404 | let tag = self.nodes[index] |
| 405 | .as_ref() |
| 406 | .expect("inserted slot stays live") |
| 407 | .tags[tag_index]; |
| 408 | self.tag_index.entry(tag).or_default().insert(id); |
| 409 | } |
| 410 | id |