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

Function insort_right

crates/stdlib/src/bisect.rs:131–148  ·  view source on GitHub ↗
(BisectArgs { a, x, lo, hi, key }: BisectArgs, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

129
130 #[pyfunction]
131 fn insort_right(BisectArgs { a, x, lo, hi, key }: BisectArgs, vm: &VirtualMachine) -> PyResult {
132 let x = if let Some(ref key) = key {
133 key.call((x,), vm)?
134 } else {
135 x
136 };
137 let index = bisect_right(
138 BisectArgs {
139 a: a.clone(),
140 x: x.clone(),
141 lo,
142 hi,
143 key,
144 },
145 vm,
146 )?;
147 vm.call_method(&a, "insert", (index, x))
148 }
149}

Callers

nothing calls this directly

Calls 4

bisect_rightFunction · 0.70
callMethod · 0.45
cloneMethod · 0.45
call_methodMethod · 0.45

Tested by

no test coverage detected