Skip to content

Commit bcf82da

Browse files
ribru17amaanq
authored andcommitted
refactor: reuse symbol variable in subtype map generator
Tiny change to prevent redundant creation of a symbol value in `node_types.rs`.
1 parent 015547c commit bcf82da

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cli/generate/src/node_types.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,7 @@ pub fn generate_node_types_json(
499499
} else if !syntax_grammar.variables_to_inline.contains(&symbol) {
500500
// If a rule is aliased under multiple names, then its information
501501
// contributes to multiple entries in the final JSON.
502-
for alias in aliases_by_symbol
503-
.get(&Symbol::non_terminal(i))
504-
.unwrap_or(&HashSet::new())
505-
{
502+
for alias in aliases_by_symbol.get(&symbol).unwrap_or(&HashSet::new()) {
506503
let kind;
507504
let is_named;
508505
if let Some(alias) = alias {

0 commit comments

Comments
 (0)