Skip to content

Commit ee568d2

Browse files
committed
simplify code in ConcurrentState::check_blocking
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 3614197 commit ee568d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/wasmtime/src/runtime/component/concurrent.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4796,10 +4796,10 @@ impl ConcurrentState {
47964796

47974797
fn check_blocking_for(&mut self, task: TableId<GuestTask>) -> Result<()> {
47984798
let task = self.get_mut(task).unwrap();
4799-
if !(task.async_function || task.returned_or_cancelled()) {
4800-
Err(Trap::CannotBlockSyncTask.into())
4801-
} else {
4799+
if task.async_function || task.returned_or_cancelled() {
48024800
Ok(())
4801+
} else {
4802+
Err(Trap::CannotBlockSyncTask.into())
48034803
}
48044804
}
48054805
}

0 commit comments

Comments
 (0)