Reduce size of scope entry.

This commit is contained in:
Stephen Chung
2020-04-27 21:14:34 +08:00
parent 43fdf3f962
commit c2bb1f48c2
2 changed files with 4 additions and 4 deletions

View File

@@ -646,12 +646,12 @@ fn optimize<'a>(
.filter(|ScopeEntry { typ, expr, .. }| {
// Get all the constants with definite constant expressions
*typ == ScopeEntryType::Constant
&& expr.as_ref().map(Expr::is_constant).unwrap_or(false)
&& expr.as_ref().map(|v| v.is_constant()).unwrap_or(false)
})
.for_each(|ScopeEntry { name, expr, .. }| {
state.push_constant(
name.as_ref(),
expr.as_ref().expect("should be Some(expr)").clone(),
(**expr.as_ref().expect("should be Some(expr)")).clone(),
)
});