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

Method remove

cranelift/bitset/src/compound.rs:367–379  ·  view source on GitHub ↗
(&mut self, i: usize)

Source from the content-addressed store, hash-verified

365 /// ```
366 #[inline]
367 pub fn remove(&mut self, i: usize) -> bool {
368 let (word, bit) = Self::word_and_bit(i);
369 if word < self.elems.len() {
370 let sub = &mut self.elems[word];
371 let was_present = sub.remove(bit);
372 if was_present && self.max() == Some(i) {
373 self.update_max(word);
374 }
375 was_present
376 } else {
377 false
378 }
379 }
380
381 /// Update the `self.max` field, based on the old word index of `self.max`.
382 fn update_max(&mut self, word_of_old_max: usize) {

Callers 1

popMethod · 0.45

Calls 3

update_maxMethod · 0.80
lenMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected