From bcf82da55cb5104ffb79781837836e5ef0a45410 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Wed, 13 Nov 2024 16:03:50 -0800 Subject: [PATCH] refactor: reuse symbol variable in subtype map generator Tiny change to prevent redundant creation of a symbol value in `node_types.rs`. --- cli/generate/src/node_types.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cli/generate/src/node_types.rs b/cli/generate/src/node_types.rs index ce0b99ce..f87a3d4b 100644 --- a/cli/generate/src/node_types.rs +++ b/cli/generate/src/node_types.rs @@ -499,10 +499,7 @@ pub fn generate_node_types_json( } else if !syntax_grammar.variables_to_inline.contains(&symbol) { // If a rule is aliased under multiple names, then its information // contributes to multiple entries in the final JSON. - for alias in aliases_by_symbol - .get(&Symbol::non_terminal(i)) - .unwrap_or(&HashSet::new()) - { + for alias in aliases_by_symbol.get(&symbol).unwrap_or(&HashSet::new()) { let kind; let is_named; if let Some(alias) = alias {