Skip to content

Commit

Permalink
[Refactoring] Reduce memory allocation on comma translation in AssignExp
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Apr 17, 2014
1 parent b7f67fe commit 7e6ea85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/expression.c
Expand Up @@ -10574,9 +10574,9 @@ Expression *AssignExp::semantic(Scope *sc)
{
/* Rewrite to get rid of the comma from rvalue
*/
AssignExp *ea = new AssignExp(loc, e1, ((CommaExp *)e2)->e2);
ea->op = op;
Expression *e = new CommaExp(loc, ((CommaExp *)e2)->e1, ea);
Expression *e0;
e2 = Expression::extractLast(e2, &e0);
Expression *e = Expression::combine(e0, this);
return e->semantic(sc);
}

Expand Down

0 comments on commit 7e6ea85

Please sign in to comment.