MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / next_node

Method next_node

cranelift/bforest/src/path.rs:166–188  ·  view source on GitHub ↗

Move path to the first entry of the next node at level, if one exists. Returns the new node if it exists. Reset the path to `size = 0` and return `None` if there is no next node.

(&mut self, level: usize, pool: &NodePool<F>)

Source from the content-addressed store, hash-verified

164 ///
165 /// Reset the path to `size = 0` and return `None` if there is no next node.
166 fn next_node(&mut self, level: usize, pool: &NodePool<F>) -> Option<Node> {
167 match self.right_sibling_branch_level(level, pool) {
168 None => {
169 self.size = 0;
170 None
171 }
172 Some(bl) => {
173 let (_, bnodes) = pool[self.node[bl]].unwrap_inner();
174 self.entry[bl] += 1;
175 let mut node = bnodes[usize::from(self.entry[bl])];
176
177 for l in bl + 1..level {
178 self.node[l] = node;
179 self.entry[l] = 0;
180 node = pool[node].unwrap_inner().1[0];
181 }
182
183 self.node[level] = node;
184 self.entry[level] = 0;
185 Some(node)
186 }
187 }
188 }
189
190 /// Move the path to the last entry of the previous leaf node, if one exists.
191 ///

Callers 3

nextMethod · 0.80
heal_levelMethod · 0.80
normalizeMethod · 0.80

Calls 3

fromFunction · 0.85
unwrap_innerMethod · 0.80

Tested by

no test coverage detected