(&self, vm: &VirtualMachine, n: isize)
| 98 | Self: AsRef<[T]>, |
| 99 | { |
| 100 | fn mul(&self, vm: &VirtualMachine, n: isize) -> PyResult<Vec<T>> { |
| 101 | let n = vm.check_repeat_or_overflow_error(self.as_ref().len(), n)?; |
| 102 | |
| 103 | if n > 1 && core::mem::size_of_val(self.as_ref()) >= MAX_MEMORY_SIZE / n { |
| 104 | return Err(vm.new_memory_error("")); |
| 105 | } |
| 106 | |
| 107 | let mut v = Vec::with_capacity(n * self.as_ref().len()); |
| 108 | for _ in 0..n { |
| 109 | v.extend_from_slice(self.as_ref()); |
| 110 | } |
| 111 | Ok(v) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | impl<T: Clone> SequenceExt<T> for [T] {} |
nothing calls this directly
no test coverage detected