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

Method wrapped_at

crates/vm/src/sliceable.rs:305–316  ·  view source on GitHub ↗
(&self, len: usize)

Source from the content-addressed store, hash-verified

303 }
304
305 fn wrapped_at(&self, len: usize) -> Option<usize> {
306 let mut p = *self;
307 if p < 0 {
308 // casting to isize is ok because it is used by wrapping_add
309 p = p.wrapping_add(len as Self);
310 }
311 if p < 0 || (p as usize) >= len {
312 None
313 } else {
314 Some(p as usize)
315 }
316 }
317}
318
319impl SequenceIndexOp for BigInt {

Callers 9

getitem_by_indexMethod · 0.80
setitem_by_indexMethod · 0.80
wrap_indexMethod · 0.80
positionMethod · 0.80
__getitem__Method · 0.80
__setitem__Method · 0.80
__delitem__Method · 0.80
getitem_by_idxMethod · 0.80
setitem_by_idxMethod · 0.80

Calls 1

SomeClass · 0.50

Tested by

no test coverage detected