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

Method insert

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

Source from the content-addressed store, hash-verified

332 /// ```
333 #[inline]
334 pub fn insert(&mut self, i: usize) -> bool {
335 self.ensure_capacity(i + 1);
336
337 let (word, bit) = Self::word_and_bit(i);
338 let is_new = self.elems[word].insert(bit);
339
340 let i = u32::try_from(i).unwrap();
341 self.max = self.max.map(|max| cmp::max(max, i)).or(Some(i));
342
343 is_new
344 }
345
346 /// Remove `i` from this bitset.
347 ///

Callers

nothing calls this directly

Calls 5

maxFunction · 0.85
ensure_capacityMethod · 0.45
unwrapMethod · 0.45
orMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected