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

Method right_sibling_branch_level

cranelift/bforest/src/path.rs:597–602  ·  view source on GitHub ↗

Find the level where the right sibling to the current node at `level` branches off. This will be an inner node with two adjacent sub-trees: In one the current node at level is a right-most node, in the other, the right sibling is a left-most node. Returns `None` if the current node is a right-most node so no right sibling exists.

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

Source from the content-addressed store, hash-verified

595 ///
596 /// Returns `None` if the current node is a right-most node so no right sibling exists.
597 fn right_sibling_branch_level(&self, level: usize, pool: &NodePool<F>) -> Option<usize> {
598 (0..level).rposition(|l| match pool[self.node[l]] {
599 NodeData::Inner { size, .. } => self.entry[l] < size,
600 _ => panic!("Expected inner node"),
601 })
602 }
603
604 /// Find the level where the left sibling to the current node at `level` branches off.
605 fn left_sibling_branch_level(&self, level: usize) -> Option<usize> {

Callers 3

next_nodeMethod · 0.80
right_siblingMethod · 0.80
update_right_crit_keyMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected