Skip to content

Commit

Permalink
ids: Rename some IndexedIdVec/IdVec methods
Browse files Browse the repository at this point in the history
* IndexedIdVec::get_id -> get_key
* IdVec::extend -> IdVec::extend_values
  • Loading branch information
jix committed Sep 28, 2024
1 parent becb92f commit 7a4ef1e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion eqy-engine/src/unroll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl Unroll {
}

fn find_unrolled_repr_var(&self, step: TimeStep, seq_var: Var) -> Option<Lit> {
let seen = self.seen_from_seq.get_id(&seq_var)?;
let seen = self.seen_from_seq.get_key(&seq_var)?;
let comb_from_seen = self.comb_from_seen.get(step)?;
let slot = comb_from_seen.get(seen)?;
*slot
Expand Down
2 changes: 1 addition & 1 deletion ids/src/id_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ impl<K: Id, V> IdVec<K, V> {

/// Inserts values from an iterator using the smallset available ids as keys.
#[inline]
pub fn extend(&mut self, iter: impl IntoIterator<Item = V>) {
pub fn extend_values(&mut self, iter: impl IntoIterator<Item = V>) {
// TODO document why we're not implementing the Extend trait
self.modify_values(|values| values.extend(iter))
}
Expand Down
2 changes: 1 addition & 1 deletion ids/src/indexed_id_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl<K: Id, V: Hash + Eq, S: BuildHasher> IndexedIdVec<K, V, S> {
/// Retrieves the key for a value in the set.
///
/// Returns `None` if the set doesn't contain the given value.
pub fn get_id<Q>(&self, value: &Q) -> Option<K>
pub fn get_key<Q>(&self, value: &Q) -> Option<K>
where
V: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Expand Down

0 comments on commit 7a4ef1e

Please sign in to comment.