Skip to content

Commit e6a25e7

Browse files
committed
perf(linter): remove unnecessary should_run check (#13639)
`rules` was already filtered with `should_run`, so this check doesn't do anything.
1 parent 476729b commit e6a25e7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

crates/oxc_linter/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,12 @@ impl Linter {
191191
let rule = *rule;
192192
// Collect node type information for rules. In large files, benchmarking showed it was worth
193193
// collecting rules into buckets by AST node type to avoid iterating over all rules for each node.
194-
if rule.should_run(&ctx_host) {
195-
if let Some(ast_types) = rule.types_info() {
196-
for ty in ast_types {
197-
rules_by_ast_type[ty as usize].push((rule, ctx));
198-
}
199-
} else {
200-
rules_any_ast_type.push((rule, ctx));
194+
if let Some(ast_types) = rule.types_info() {
195+
for ty in ast_types {
196+
rules_by_ast_type[ty as usize].push((rule, ctx));
201197
}
198+
} else {
199+
rules_any_ast_type.push((rule, ctx));
202200
}
203201

204202
rule.run_once(ctx);

0 commit comments

Comments
 (0)