Skip to content

Commit

Permalink
Fix implementation of DeBruijnMap::is_empty
Browse files Browse the repository at this point in the history
  • Loading branch information
bpandreotti committed Feb 26, 2024
1 parent 1421309 commit f9901be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion carcara/src/ast/polyeq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ impl DeBruijnMap {
}

fn is_empty(&self) -> bool {
self.indices.0.is_empty() && self.indices.1.is_empty() && self.counter.is_empty()
self.indices.0.is_empty() && self.indices.1.is_empty()
}

fn push(&mut self) {
Expand Down
6 changes: 1 addition & 5 deletions carcara/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,8 @@ impl<K, V> HashMapStack<K, V> {
Self { scopes: vec![IndexMap::new()] }
}

pub fn height(&self) -> usize {
self.scopes.len()
}

pub fn is_empty(&self) -> bool {
self.height() == 0
self.scopes.iter().all(IndexMap::is_empty)
}

pub fn push_scope(&mut self) {
Expand Down

0 comments on commit f9901be

Please sign in to comment.