Use debug_assert.

This commit is contained in:
Stephen Chung
2023-03-23 09:12:48 +08:00
parent 2c94f956e5
commit 3c7cd8e278
7 changed files with 19 additions and 24 deletions

View File

@@ -236,8 +236,7 @@ impl Engine {
mut this_ptr: Option<&mut Dynamic>,
expr: &Expr,
) -> RhaiResult {
// Coded this way for better branch prediction.
// Popular branches are lifted out of the `match` statement into their own branches.
self.track_operation(global, expr.position())?;
#[cfg(feature = "debugging")]
let reset =
@@ -245,8 +244,6 @@ impl Engine {
#[cfg(feature = "debugging")]
auto_restore! { global if Some(reset) => move |g| g.debugger_mut().reset_status(reset) }
self.track_operation(global, expr.position())?;
match expr {
// Constants
Expr::IntegerConstant(x, ..) => Ok((*x).into()),