Simplify to calc_fn_hash.

This commit is contained in:
Stephen Chung
2022-09-21 11:46:23 +08:00
parent d7ae65c425
commit 5d275b5307
12 changed files with 65 additions and 85 deletions

View File

@@ -666,7 +666,7 @@ impl Expr {
#[cfg(not(feature = "no_module"))]
namespace: super::Namespace::NONE,
name: KEYWORD_FN_PTR.into(),
hashes: calc_fn_hash(f.fn_name(), 1).into(),
hashes: calc_fn_hash(None, f.fn_name(), 1).into(),
args: once(Self::StringConstant(f.fn_name().into(), pos)).collect(),
capture_parent_scope: false,
is_native_operator: false,

View File

@@ -74,8 +74,8 @@ impl OpAssignment {
.expect("op-assignment operator")
.literal_syntax();
Self {
hash_op_assign: calc_fn_hash(op.literal_syntax(), 2),
hash_op: calc_fn_hash(op_raw, 2),
hash_op_assign: calc_fn_hash(None, op.literal_syntax(), 2),
hash_op: calc_fn_hash(None, op_raw, 2),
op_assign: op.literal_syntax(),
op: op_raw,
pos,