Use standard operator to short-circuit.

This commit is contained in:
Stephen Chung
2022-09-03 12:35:00 +08:00
parent 75512bfd2f
commit 43c4d7e3ca
2 changed files with 7 additions and 4 deletions

View File

@@ -989,6 +989,7 @@ impl Engine {
args_expr: &[Expr],
hashes: FnCallHashes,
capture_scope: bool,
is_standard_operator: bool,
pos: Position,
level: usize,
) -> RhaiResult {
@@ -1001,6 +1002,8 @@ impl Engine {
let redirected; // Handle call() - Redirect function call
match name {
_ if is_standard_operator => (),
// Handle call()
KEYWORD_FN_PTR_CALL if total_args >= 1 => {
let arg = first_arg.unwrap();