diff --git a/carcara/src/ast/polyeq.rs b/carcara/src/ast/polyeq.rs index 4c2df07d..fe0be2ce 100644 --- a/carcara/src/ast/polyeq.rs +++ b/carcara/src/ast/polyeq.rs @@ -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) { diff --git a/carcara/src/utils.rs b/carcara/src/utils.rs index 98d52e6b..ac601b93 100644 --- a/carcara/src/utils.rs +++ b/carcara/src/utils.rs @@ -111,12 +111,8 @@ impl HashMapStack { 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) {