Simplify debugger calls.
This commit is contained in:
@@ -266,11 +266,8 @@ impl Engine {
|
||||
// binary operators are also function calls.
|
||||
if let Expr::FnCall(x, pos) = expr {
|
||||
#[cfg(feature = "debugging")]
|
||||
let reset_debugger = if self.debugger.is_some() {
|
||||
self.run_debugger_with_reset(scope, global, state, lib, this_ptr, expr, level)?
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let reset_debugger =
|
||||
self.run_debugger_with_reset(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
self.inc_operations(&mut global.num_operations, expr.position())?;
|
||||
@@ -289,9 +286,7 @@ impl Engine {
|
||||
// will cost more than the mis-predicted `match` branch.
|
||||
if let Expr::Variable(index, var_pos, x) = expr {
|
||||
#[cfg(feature = "debugging")]
|
||||
if self.debugger.is_some() {
|
||||
self.run_debugger(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
}
|
||||
self.run_debugger(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
self.inc_operations(&mut global.num_operations, expr.position())?;
|
||||
@@ -308,11 +303,8 @@ impl Engine {
|
||||
}
|
||||
|
||||
#[cfg(feature = "debugging")]
|
||||
let reset_debugger = if self.debugger.is_some() {
|
||||
self.run_debugger_with_reset(scope, global, state, lib, this_ptr, expr, level)?
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let reset_debugger =
|
||||
self.run_debugger_with_reset(scope, global, state, lib, this_ptr, expr, level)?;
|
||||
|
||||
#[cfg(not(feature = "unchecked"))]
|
||||
self.inc_operations(&mut global.num_operations, expr.position())?;
|
||||
|
Reference in New Issue
Block a user