From 76ab80100177403a1a860ce4f01c5e791377afb0 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 24 Mar 2016 10:58:57 +0100 Subject: [PATCH] if a < b { ... } if a >= b { ... } what am I doing? --- src/booleans.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/booleans.rs b/src/booleans.rs index e290b896b1d..f4437249b4c 100644 --- a/src/booleans.rs +++ b/src/booleans.rs @@ -227,10 +227,8 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> { if stats[i] < simplified_stats[i] { continue 'simplified; } - // if the number of occurrences of a terminal decreases, this expression is a candidate for improvement - if stats[i] >= simplified_stats[i] { - improvement = true; - } + // if the number of occurrences of a terminal doesn't increase, this expression is a candidate for improvement + improvement = true; if stats[i] != 0 && simplified_stats[i] == 0 { span_lint_and_then(self.0, LOGIC_BUG, e.span, "this boolean expression contains a logic bug", |db| { db.span_help(h2q.terminals[i].span, "this expression can be optimized out by applying boolean operations to the outer expression");