summaryrefslogtreecommitdiff
path: root/6
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2012-08-05 16:52:49 -0400
committerOri Bernstein <ori@eigenstate.org>2012-08-05 16:52:49 -0400
commit40478b756a78ca52baeb4650269e6cdc313dac17 (patch)
tree4257282146553733f548cde17c14e9a447f9410d /6
parent38bff109c49599383fabf9163bda5954af1ffab5 (diff)
downloadmc-40478b756a78ca52baeb4650269e6cdc313dac17.tar.gz
Simplify inc/dec.
Diffstat (limited to '6')
-rw-r--r--6/simp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/6/simp.c b/6/simp.c
index 5a43354..02e0915 100644
--- a/6/simp.c
+++ b/6/simp.c
@@ -1034,13 +1034,11 @@ static Node *rval(Simp *s, Node *n, Node *dst)
* x = x + 1
*/
case Opostinc:
- r = rval(s, args[0], NULL);
- t = set(lval(s, args[0]), addk(r, 1));
+ t = assign(s, args[0], addk(args[0], 1));
lappend(&s->incqueue, &s->nqueue, t);
break;
case Opostdec:
- r = rval(s, args[0], NULL);
- t = set(lval(s, args[0]), subk(r, 1));
+ t = assign(s, args[0], subk(args[0], 1));
lappend(&s->incqueue, &s->nqueue, t);
break;
case Olit: