MCPcopy Index your code
hub / github.com/RustPython/RustPython / stackdepth_push

Function stackdepth_push

crates/codegen/src/ir.rs:1848–1860  ·  view source on GitHub ↗
(
    stack: &mut Vec<BlockIdx>,
    start_depths: &mut [u32],
    target: BlockIdx,
    depth: u32,
)

Source from the content-addressed store, hash-verified

1846}
1847
1848fn stackdepth_push(
1849 stack: &mut Vec<BlockIdx>,
1850 start_depths: &mut [u32],
1851 target: BlockIdx,
1852 depth: u32,
1853) {
1854 let idx = target.idx();
1855 let block_depth = &mut start_depths[idx];
1856 if depth > *block_depth || *block_depth == u32::MAX {
1857 *block_depth = depth;
1858 stack.push(target);
1859 }
1860}
1861
1862fn iter_blocks(blocks: &[Block]) -> impl Iterator<Item = (BlockIdx, &Block)> + '_ {
1863 let mut next = BlockIdx(0);

Callers 1

max_stackdepthMethod · 0.85

Calls 2

idxMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected