Skip to content

Commit

Permalink
vm: remove redundant state existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
whfuyn committed Apr 18, 2024
1 parent 551d6d6 commit 67a3380
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/vm/op_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,8 @@ impl InstructionSet for ContractOp {
}
macro_rules! load_inputs {
($state_type:ident) => {{
if !context.prev_state.contains_key($state_type) {
return ExecStep::Next;
}
let Some(prev_state) = context.prev_state.get($state_type) else {
fail!()
return ExecStep::Next;
};
match prev_state {
TypedAssigns::Fungible(state) => state
Expand All @@ -245,11 +242,8 @@ impl InstructionSet for ContractOp {
}
macro_rules! load_outputs {
($state_type:ident) => {{
if !context.owned_state.has_type(*$state_type) {
return ExecStep::Next;
}
let Some(new_state) = context.owned_state.get(*$state_type) else {
fail!()
return ExecStep::Next;
};
match new_state {
TypedAssigns::Fungible(state) => state
Expand Down

0 comments on commit 67a3380

Please sign in to comment.