(&self, path: &[u8])
| 294 | } |
| 295 | |
| 296 | pub fn find_or_create_node(&self, path: &[u8]) -> &Self { |
| 297 | let mut current = self; |
| 298 | for &idx in path { |
| 299 | let new_node_idx = current.node_idx + (1u16 << (idx * 2)); |
| 300 | let (child, _) = current.children.get_or_insert(idx as usize, || { |
| 301 | Box::into_raw(Box::new(Self::new(new_node_idx))) |
| 302 | }); |
| 303 | current = unsafe { &*child }; |
| 304 | } |
| 305 | current |
| 306 | } |
| 307 | |
| 308 | pub fn insert(&self, version: VersionNumber, quotient: u64, value: T) { |
| 309 | self.quotients.insert(version, quotient, value); |
no test coverage detected