From eddba2634004efd193fcd37c55500b5fa201f303 Mon Sep 17 00:00:00 2001 From: jedel1043 Date: Mon, 19 Jun 2023 15:47:48 -0600 Subject: [PATCH] Apply review pt.2 --- boa_engine/src/vm/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/boa_engine/src/vm/mod.rs b/boa_engine/src/vm/mod.rs index 9e7ea405033..dfc67ef7cb3 100644 --- a/boa_engine/src/vm/mod.rs +++ b/boa_engine/src/vm/mod.rs @@ -180,9 +180,7 @@ impl Context<'_> { let completion = loop { let completion = self.run_next_instruction(|opcode, context| { - total_cost = total_cost - .checked_add(usize::from(opcode.cost())) - .unwrap_or(usize::MAX); + total_cost = total_cost.saturating_add(usize::from(opcode.cost())); opcode.execute(context) }); if let ControlFlow::Break(completion) = completion {