Use interned strings for AST nodes.

This commit is contained in:
Stephen Chung
2022-08-13 18:07:42 +08:00
parent 1c7b80ed13
commit 28743594d0
11 changed files with 147 additions and 205 deletions

View File

@@ -759,12 +759,12 @@ impl Module {
let num_params = fn_def.params.len();
let hash_script = crate::calc_fn_hash(&fn_def.name, num_params);
#[cfg(feature = "metadata")]
let params_info = fn_def.params.iter().cloned().collect();
let params_info = fn_def.params.iter().map(Into::into).collect();
self.functions.insert(
hash_script,
FuncInfo {
metadata: FnMetadata {
name: fn_def.name.clone(),
name: fn_def.name.as_str().into(),
namespace: FnNamespace::Internal,
access: fn_def.access,
params: num_params,