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

Method count

crates/vm/src/bytes_inner.rs:541–546  ·  view source on GitHub ↗
(&self, options: ByteInnerFindOptions, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

539 }
540
541 pub fn count(&self, options: ByteInnerFindOptions, vm: &VirtualMachine) -> PyResult<usize> {
542 let (needle, range) = options.get_value(self.elements.len(), vm)?;
543 Ok(self
544 .elements
545 .py_count(needle.as_slice(), range, |h, n| h.find_iter(n).count()))
546 }
547
548 pub fn join(&self, iterable: ArgIterable<Self>, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
549 let iter = iterable.iter(vm)?;

Callers 1

count_substringFunction · 0.45

Calls 5

py_countMethod · 0.80
find_iterMethod · 0.80
get_valueMethod · 0.45
lenMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected