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

Method repeat

crates/vm/src/builtins/list.rs:146–150  ·  view source on GitHub ↗
(&self, n: isize, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

144 }
145
146 fn repeat(&self, n: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
147 let elements = &*self.borrow_vec();
148 let v = elements.mul(vm, n)?;
149 Ok(Self::from(v).into_ref(&vm.ctx))
150 }
151
152 fn irepeat(zelf: PyRef<Self>, n: isize, vm: &VirtualMachine) -> PyResult<PyRef<Self>> {
153 zelf.borrow_vec_mut().imul(vm, n)?;

Callers 1

__mul__Method · 0.45

Calls 3

borrow_vecMethod · 0.80
mulMethod · 0.45
into_refMethod · 0.45

Tested by

no test coverage detected