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

Method index_of

crates/vm/src/builtins/range.rs:131–137  ·  view source on GitHub ↗
(&self, value: &BigInt)

Source from the content-addressed store, hash-verified

129
130 #[inline]
131 pub fn index_of(&self, value: &BigInt) -> Option<BigInt> {
132 let step = self.step.as_bigint();
133 match self.offset(value) {
134 Some(ref offset) if offset.is_multiple_of(step) => Some((offset / step).abs()),
135 Some(_) | None => None,
136 }
137 }
138
139 #[inline]
140 pub fn is_empty(&self) -> bool {

Callers 2

indexMethod · 0.80
countMethod · 0.80

Calls 4

as_bigintMethod · 0.80
absMethod · 0.80
SomeClass · 0.50
offsetMethod · 0.45

Tested by

no test coverage detected