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

Method _get_inner

crates/vm/src/dict_inner.rs:384–405  ·  view source on GitHub ↗
(
        &self,
        vm: &VirtualMachine,
        key: &K,
        hash: HashValue,
    )

Source from the content-addressed store, hash-verified

382 }
383
384 fn _get_inner<K: DictKey + ?Sized>(
385 &self,
386 vm: &VirtualMachine,
387 key: &K,
388 hash: HashValue,
389 ) -> PyResult<Option<T>> {
390 let ret = loop {
391 let (entry, index_index) = self.lookup(vm, key, hash, None)?;
392 if let Some(index) = entry.index() {
393 let inner = self.read();
394 if let Some(entry) = inner.get_entry_checked(index, index_index) {
395 break Some(entry.value.clone());
396 } else {
397 // The dict was changed since we did lookup. Let's try again.
398 continue;
399 }
400 } else {
401 break None;
402 }
403 };
404 Ok(ret)
405 }
406
407 pub fn get_chain<K: DictKey + ?Sized>(
408 &self,

Callers 2

getMethod · 0.80
get_chainMethod · 0.80

Calls 6

get_entry_checkedMethod · 0.80
SomeClass · 0.50
lookupMethod · 0.45
indexMethod · 0.45
readMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected