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

Method remove

cranelift/bforest/src/map.rs:155–167  ·  view source on GitHub ↗

Remove `key` from the map and return the removed value for `key`, if any.

(
        &mut self,
        key: K,
        forest: &mut MapForest<K, V>,
        comp: &C,
    )

Source from the content-addressed store, hash-verified

153
154 /// Remove `key` from the map and return the removed value for `key`, if any.
155 pub fn remove<C: Comparator<K>>(
156 &mut self,
157 key: K,
158 forest: &mut MapForest<K, V>,
159 comp: &C,
160 ) -> Option<V> {
161 let mut c = self.cursor_mut(forest, comp);
162 if c.goto(key).is_some() {
163 c.remove()
164 } else {
165 None
166 }
167 }
168
169 /// Remove all entries.
170 pub fn clear(&mut self, forest: &mut MapForest<K, V>) {

Callers 1

retainMethod · 0.45

Calls 4

cursor_mutMethod · 0.80
is_someMethod · 0.45
gotoMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected