Use fast operators mode in rhai-run.
This commit is contained in:
parent
06dea067b7
commit
2de4325d7e
@ -50,6 +50,8 @@ fn main() {
|
||||
// Initialize scripting engine
|
||||
let mut engine = Engine::new();
|
||||
|
||||
engine.set_fast_operators(true);
|
||||
|
||||
#[cfg(not(feature = "no_optimize"))]
|
||||
engine.set_optimization_level(rhai::OptimizationLevel::Simple);
|
||||
|
||||
|
@ -228,6 +228,7 @@ impl Engine {
|
||||
..
|
||||
} = expr;
|
||||
|
||||
// Short-circuit operator call if under Fast Operators mode
|
||||
if *std_ops && self.fast_operators() {
|
||||
let mut lhs = self
|
||||
.get_arg_value(scope, global, caches, lib, this_ptr, &args[0], level)?
|
||||
|
Loading…
Reference in New Issue
Block a user