Method
unpack_single
(&self, pos: usize, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 205 | } |
| 206 | |
| 207 | fn unpack_single(&self, pos: usize, vm: &VirtualMachine) -> PyResult { |
| 208 | let bytes = self.buffer.obj_bytes(); |
| 209 | // TODO: Optimize |
| 210 | self.format_spec |
| 211 | .unpack(&bytes[pos..pos + self.desc.itemsize], vm) |
| 212 | .map(|x| { |
| 213 | if x.len() == 1 { |
| 214 | x[0].to_owned() |
| 215 | } else { |
| 216 | x.into() |
| 217 | } |
| 218 | }) |
| 219 | } |
| 220 | |
| 221 | fn pos_from_multi_index(&self, indexes: &[isize], vm: &VirtualMachine) -> PyResult<usize> { |
| 222 | match indexes.len().cmp(&self.desc.ndim()) { |
Tested by
no test coverage detected