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

Method get_localsplus_name

crates/codegen/src/ir.rs:1832–1845  ·  view source on GitHub ↗
(&self, var_num: oparg::VarNum)

Source from the content-addressed store, hash-verified

1830 }
1831
1832 fn get_localsplus_name(&self, var_num: oparg::VarNum) -> &str {
1833 let idx = var_num.as_usize();
1834 let nlocals = self.metadata.varnames.len();
1835 if idx < nlocals {
1836 self.metadata.varnames[idx].as_ref()
1837 } else {
1838 let cell_idx = idx - nlocals;
1839 self.metadata
1840 .cellvars
1841 .get_index(cell_idx)
1842 .unwrap_or_else(|| &self.metadata.freevars[cell_idx - self.metadata.cellvars.len()])
1843 .as_ref()
1844 }
1845 }
1846}
1847
1848fn stackdepth_push(

Callers

nothing calls this directly

Calls 3

get_indexMethod · 0.80
lenMethod · 0.45
as_refMethod · 0.45

Tested by

no test coverage detected