From a1aca80e0dc5cf0fcb7b467dd469c639353f19d6 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 21 Feb 2016 18:43:37 -0500 Subject: Simplify double-negation. --- parse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'parse.c') diff --git a/parse.c b/parse.c index 7863154..8376378 100644 --- a/parse.c +++ b/parse.c @@ -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); } -- cgit v1.2.3