if a < b { ... } if a >= b { ... } what am I doing?

This commit is contained in:
Oliver Schneider 2016-03-24 10:58:57 +01:00
parent 37cee84c44
commit 76ab801001

View file

@ -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");