diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-02-21 18:43:37 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-02-21 18:43:37 -0500 |
commit | a1aca80e0dc5cf0fcb7b467dd469c639353f19d6 (patch) | |
tree | fc5ab6a939e07d96093459f704b1e11a8744e910 | |
parent | eb3af1b4ab071e7e3a1f01a3f62390f976592e06 (diff) | |
download | bfs-a1aca80e0dc5cf0fcb7b467dd469c639353f19d6.tar.xz |
Simplify double-negation.
-rw-r--r-- | parse.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -909,6 +909,11 @@ static struct expr *new_not_expr(struct expr *rhs) { return &expr_false; } else if (rhs == &expr_false) { return &expr_true; + } else if (rhs->eval == eval_not) { + struct expr *expr = rhs->rhs; + rhs->rhs = NULL; + free_expr(rhs); + return expr; } else { return new_unary_expr(eval_not, rhs); } |