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

Method remove

cranelift/entity/src/map.rs:133–141  ·  view source on GitHub ↗

Remove the element at `k`, if it exists, replacing it with the default value.

(&mut self, k: K)

Source from the content-addressed store, hash-verified

131 /// Remove the element at `k`, if it exists, replacing it with the default
132 /// value.
133 pub fn remove(&mut self, k: K) -> Option<V> {
134 let i = k.index();
135 if i < self.elems.len() {
136 let default = self.default.clone();
137 Some(core::mem::replace(&mut self.elems[i], default))
138 } else {
139 None
140 }
141 }
142
143 /// Is this map completely empty?
144 #[inline(always)]

Callers 13

popMethod · 0.45
process_defMethod · 0.45
vir_expr_to_sexpMethod · 0.45
solve_constraintsFunction · 0.45
variadic_binopFunction · 0.45
remove_set_ofMethod · 0.45
reportMethod · 0.45
mutateMethod · 0.45
basicFunction · 0.45
mainFunction · 0.45
applyMethod · 0.45
compileMethod · 0.45

Calls 4

replaceFunction · 0.50
indexMethod · 0.45
lenMethod · 0.45
cloneMethod · 0.45

Tested by 1

basicFunction · 0.36