Skip to content

Commit 7af2aa4

Browse files
committed
Simplify cpu loop
1 parent 55290a1 commit 7af2aa4

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

contracts/cyberpunk/src/contract.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,8 @@ fn execute_argon2(mem_cost: u32, time_cost: u32) -> Result<Response, ContractErr
6565
}
6666

6767
fn execute_cpu_loop() -> Result<Response, ContractError> {
68-
let mut counter = 0u64;
69-
loop {
70-
counter += 1;
71-
if counter >= 9_000_000_000 {
72-
counter = 0;
73-
}
74-
}
68+
#[allow(clippy::empty_loop)]
69+
loop {}
7570
}
7671

7772
fn execute_storage_loop(deps: DepsMut) -> Result<Response, ContractError> {

packages/vm/testdata/cyberpunk.wasm

-5.69 KB
Binary file not shown.

0 commit comments

Comments
 (0)