Optimize data structures.

This commit is contained in:
Stephen Chung
2021-03-30 23:55:29 +08:00
parent 6eb6e07d57
commit a049f7b5ba
4 changed files with 46 additions and 33 deletions

View File

@@ -385,10 +385,10 @@ fn optimize_stmt(stmt: &mut Stmt, state: &mut State, preserve_result: bool) {
match stmt {
// expr op= expr
Stmt::Assignment(x, _) => match x.0 {
Expr::Variable(_) => optimize_expr(&mut x.1, state),
Expr::Variable(_) => optimize_expr(&mut x.2, state),
_ => {
optimize_expr(&mut x.0, state);
optimize_expr(&mut x.1, state);
optimize_expr(&mut x.2, state);
}
},