Skip to content

Commit b81f081

Browse files
committed
perf(linter): reduce indirection (#13574)
Follow-on after #13138, as per [this comment](#13138 (comment)). Previously `rules_by_ast_type` and `rules_any_ast_type` contained `&&RuleEnum`, which is unnecessary indirection. Store `&RuleEnum` instead.
1 parent c6ebe6b commit b81f081

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

crates/oxc_linter/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ impl Linter {
181181
let mut rules_any_ast_type = Vec::with_capacity(rules.len());
182182

183183
for (rule, ctx) in &rules {
184+
let rule = *rule;
184185
// Collect node type information for rules. In large files, benchmarking showed it was worth
185186
// collecting rules into buckets by AST node type to avoid iterating over all rules for each node.
186187
if rule.should_run(&ctx_host) {

0 commit comments

Comments
 (0)