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

Method zip_eq

crates/vm/src/protocol/buffer.rs:319–332  ·  view source on GitHub ↗

zip two BufferDescriptor with the same shape

(&self, other: &Self, try_contiguous: bool, mut f: F)

Source from the content-addressed store, hash-verified

317
318 /// zip two BufferDescriptor with the same shape
319 pub fn zip_eq<F>(&self, other: &Self, try_contiguous: bool, mut f: F)
320 where
321 F: FnMut(Range<isize>, Range<isize>) -> bool,
322 {
323 if self.ndim() == 0 {
324 f(0..self.itemsize as isize, 0..other.itemsize as isize);
325 return;
326 }
327 if try_contiguous && self.is_last_dim_contiguous() {
328 self._zip_eq::<_, true>(other, 0, 0, 0, &mut f);
329 } else {
330 self._zip_eq::<_, false>(other, 0, 0, 0, &mut f);
331 }
332 }
333
334 fn _zip_eq<F, const CONTIGUOUS: bool>(
335 &self,

Callers 6

eqMethod · 0.80
with_kwargs_namesMethod · 0.80
fast_positionMethod · 0.80
positionMethod · 0.80
eqMethod · 0.80
setitem_by_sliceMethod · 0.80

Calls 3

fFunction · 0.50
ndimMethod · 0.45

Tested by

no test coverage detected