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

Method fast_next

crates/vm/src/builtins/tuple.rs:671–684  ·  view source on GitHub ↗

Fast path for FOR_ITER specialization.

(&self)

Source from the content-addressed store, hash-verified

669impl PyTupleIterator {
670 /// Fast path for FOR_ITER specialization.
671 pub(crate) fn fast_next(&self) -> Option<PyObjectRef> {
672 self.internal
673 .lock()
674 .next(|tuple, pos| {
675 Ok(PyIterReturn::from_result(
676 tuple.get(pos).cloned().ok_or(None),
677 ))
678 })
679 .ok()
680 .and_then(|r| match r {
681 PyIterReturn::Return(v) => Some(v),
682 PyIterReturn::StopIteration(_) => None,
683 })
684 }
685}
686
687impl SelfIter for PyTupleIterator {}

Callers

nothing calls this directly

Calls 5

okMethod · 0.80
SomeClass · 0.50
nextMethod · 0.45
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected