mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
further optimizations
This commit is contained in:
parent
df83bf0d48
commit
24ddc4b1e8
4 changed files with 90 additions and 17 deletions
|
@ -60,6 +60,22 @@ impl Constraint {
|
|||
|
||||
true
|
||||
}
|
||||
|
||||
pub fn contains_save_the_environment(&self) -> bool {
|
||||
match self {
|
||||
Constraint::Eq(_, _, _, _) => false,
|
||||
Constraint::Store(_, _, _, _) => false,
|
||||
Constraint::Lookup(_, _, _) => false,
|
||||
Constraint::Pattern(_, _, _, _) => false,
|
||||
Constraint::True => false,
|
||||
Constraint::SaveTheEnvironment => true,
|
||||
Constraint::Let(boxed) => {
|
||||
boxed.ret_constraint.contains_save_the_environment()
|
||||
|| boxed.defs_constraint.contains_save_the_environment()
|
||||
}
|
||||
Constraint::And(cs) => cs.iter().any(|c| c.contains_save_the_environment()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn subtract(declared: &Declared, detail: &VariableDetail, accum: &mut VariableDetail) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue