Browse Source

cranelift-entity: Add a method to pre-reserve capacity to `EntitySet` (#9069)

Just exposing functionality that already exists in the underlying bitset
implementation.

Will be used in a follow-up pull request.
pull/9071/head
Nick Fitzgerald 3 months ago
committed by GitHub
parent
commit
cb0cac2f3f
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      cranelift/entity/src/set.rs

6
cranelift/entity/src/set.rs

@ -53,6 +53,12 @@ where
}
}
/// Ensure that the set has enough capacity to hold `capacity` total
/// elements.
pub fn ensure_capacity(&mut self, capacity: usize) {
self.bitset.ensure_capacity(capacity);
}
/// Get the element at `k` if it exists.
pub fn contains(&self, k: K) -> bool {
let index = k.index();

Loading…
Cancel
Save