about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2024-08-03 12:02:02 +0000
committerAlex Macleod <alex@macleod.io>2024-08-03 12:07:42 +0000
commitb2d06313008194ef30751a8d85d37c3e0c78546b (patch)
tree2b392328dfde1b53e90cee01a9f4e57b7f7e4e6a /clippy_lints/src
parent834b691a9f00b3c1d0f6c7f1ecb1a6badacf7f8b (diff)
Limit number of nonminimal_bool ops
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/booleans.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/clippy_lints/src/booleans.rs b/clippy_lints/src/booleans.rs
index a1c6c0b608f..a2f48c18170 100644
--- a/clippy_lints/src/booleans.rs
+++ b/clippy_lints/src/booleans.rs
@@ -477,14 +477,12 @@ impl<'a, 'tcx> NonminimalBoolVisitor<'a, 'tcx> {
             cx: self.cx,
         };
         if let Ok(expr) = h2q.run(e) {
-            if h2q.terminals.len() > 8 {
-                // QMC has exponentially slow behavior as the number of terminals increases
-                // 8 is reasonable, it takes approximately 0.2 seconds.
-                // See #825
+            let stats = terminal_stats(&expr);
+            if stats.ops > 7 {
+                // QMC has exponentially slow behavior as the number of ops increases.
+                // See #825, #13206
                 return;
             }
-
-            let stats = terminal_stats(&expr);
             let mut simplified = expr.simplify();
             for simple in Bool::Not(Box::new(expr)).simplify() {
                 match simple {