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

Method prev_entry

crates/vm/src/dict_inner.rs:605–614  ·  view source on GitHub ↗
(&self, mut position: EntryIndex)

Source from the content-addressed store, hash-verified

603 }
604
605 pub fn prev_entry(&self, mut position: EntryIndex) -> Option<(usize, PyObjectRef, T)> {
606 let inner = self.read();
607 loop {
608 let entry = inner.entries.get(position)?;
609 position = position.saturating_sub(1);
610 if let Some(entry) = entry {
611 break Some((position, entry.key.clone(), entry.value.clone()));
612 }
613 }
614 }
615
616 pub fn len_from_entry_index(&self, position: EntryIndex) -> usize {
617 self.read().entries.len().saturating_sub(position)

Callers

nothing calls this directly

Calls 4

SomeClass · 0.50
readMethod · 0.45
getMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected