(zelf: &Py<Self>, n: isize, vm: &VirtualMachine)
| 150 | } |
| 151 | |
| 152 | fn irepeat(zelf: &Py<Self>, n: isize, vm: &VirtualMachine) -> PyResult<()> { |
| 153 | if n == 1 { |
| 154 | return Ok(()); |
| 155 | } |
| 156 | let mut w = match zelf.try_resizable(vm) { |
| 157 | Ok(w) => w, |
| 158 | Err(err) => { |
| 159 | return if zelf.borrow_buf().is_empty() { |
| 160 | // We can multiple an empty vector by any integer |
| 161 | Ok(()) |
| 162 | } else { |
| 163 | Err(err) |
| 164 | }; |
| 165 | } |
| 166 | }; |
| 167 | |
| 168 | w.imul(n, vm) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | #[pyclass( |
nothing calls this directly
no test coverage detected