MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / get

Method get

cranelift/entity/src/sparse.rs:99–108  ·  view source on GitHub ↗

Returns a reference to the value corresponding to the key.

(&self, key: K)

Source from the content-addressed store, hash-verified

97
98 /// Returns a reference to the value corresponding to the key.
99 pub fn get(&self, key: K) -> Option<&V> {
100 if let Some(idx) = self.sparse.get(key).cloned() {
101 if let Some(entry) = self.dense.get(idx as usize) {
102 if entry.key() == key {
103 return Some(entry);
104 }
105 }
106 }
107 None
108 }
109
110 /// Returns a mutable reference to the value corresponding to the key.
111 ///

Callers 3

get_mutMethod · 0.45
indexMethod · 0.45
contains_keyMethod · 0.45

Calls 1

keyMethod · 0.45

Tested by

no test coverage detected