Speed up FnPtr::call when there is a linked scripted function.

This commit is contained in:
Stephen Chung
2022-12-11 16:55:30 +08:00
parent 91f149270a
commit 1f815f995f
6 changed files with 186 additions and 268 deletions

View File

@@ -422,15 +422,15 @@ impl<'a> NativeCallContext<'a> {
is_ref_mut: bool,
is_method_call: bool,
) -> RhaiResult {
let mut global = &mut self.global.clone();
let global = &mut self.global.clone();
global.level += 1;
let caches = &mut Caches::new();
let fn_name = fn_name.as_ref();
let op_token = Token::lookup_symbol_from_syntax(fn_name).unwrap_or(NO_TOKEN);
let args_len = args.len();
global.level += 1;
if native_only {
return self
.engine()