Make Engine faster to create.

This commit is contained in:
Stephen Chung
2023-02-25 19:57:19 +08:00
parent c2a8c342bb
commit 51581cdef5
13 changed files with 184 additions and 115 deletions

View File

@@ -2354,7 +2354,6 @@ impl Engine {
let op = op_token.to_string();
let hash = calc_fn_hash(None, &op, 2);
let native_only = !is_valid_function_name(&op);
let operator_token = native_only.then(|| op_token.clone());
let mut args = FnArgsVec::new_const();
args.push(root);
@@ -2366,7 +2365,7 @@ impl Engine {
name: state.get_interned_string(&op),
hashes: FnCallHashes::from_native_only(hash),
args,
op_token: operator_token,
op_token: native_only.then(|| op_token.clone()),
capture_parent_scope: false,
};